Adjusting the breakout optimizer for custom pads
Rather than using the center of the bounding box, we keep the start track on the custom pad's connection pad when optimizing the breakout.
This commit is contained in:
parent
b2c4519c2c
commit
9648584827
|
@ -665,14 +665,14 @@ OPTIMIZER::BREAKOUT_LIST OPTIMIZER::circleBreakouts( int aWidth,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
OPTIMIZER::BREAKOUT_LIST OPTIMIZER::convexBreakouts( int aWidth,
|
OPTIMIZER::BREAKOUT_LIST OPTIMIZER::customBreakouts( int aWidth,
|
||||||
const SHAPE* aShape, bool aPermitDiagonal ) const
|
const ITEM* aItem, bool aPermitDiagonal ) const
|
||||||
{
|
{
|
||||||
BREAKOUT_LIST breakouts;
|
BREAKOUT_LIST breakouts;
|
||||||
const SHAPE_SIMPLE* convex = static_cast<const SHAPE_SIMPLE*>( aShape );
|
const SHAPE_SIMPLE* convex = static_cast<const SHAPE_SIMPLE*>( aItem->Shape() );
|
||||||
|
|
||||||
BOX2I bbox = convex->BBox( 0 );
|
BOX2I bbox = convex->BBox( 0 );
|
||||||
VECTOR2I p0 = bbox.Centre();
|
VECTOR2I p0 = static_cast<const SOLID*>( aItem )->Pos();
|
||||||
// must be large enough to guarantee intersecting the convex polygon
|
// must be large enough to guarantee intersecting the convex polygon
|
||||||
int length = bbox.GetSize().EuclideanNorm() / 2 + 5;
|
int length = bbox.GetSize().EuclideanNorm() / 2 + 5;
|
||||||
|
|
||||||
|
@ -792,11 +792,13 @@ OPTIMIZER::BREAKOUT_LIST OPTIMIZER::computeBreakouts( int aWidth,
|
||||||
return circleBreakouts( aWidth, shape, aPermitDiagonal );
|
return circleBreakouts( aWidth, shape, aPermitDiagonal );
|
||||||
|
|
||||||
case SH_SIMPLE:
|
case SH_SIMPLE:
|
||||||
return convexBreakouts( aWidth, shape, aPermitDiagonal );
|
return customBreakouts( aWidth, aItem, aPermitDiagonal );
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -161,7 +161,7 @@ private:
|
||||||
BREAKOUT_LIST circleBreakouts( int aWidth, const SHAPE* aShape, bool aPermitDiagonal ) const;
|
BREAKOUT_LIST circleBreakouts( int aWidth, const SHAPE* aShape, bool aPermitDiagonal ) const;
|
||||||
BREAKOUT_LIST rectBreakouts( int aWidth, const SHAPE* aShape, bool aPermitDiagonal ) const;
|
BREAKOUT_LIST rectBreakouts( int aWidth, const SHAPE* aShape, bool aPermitDiagonal ) const;
|
||||||
BREAKOUT_LIST ovalBreakouts( int aWidth, const SHAPE* aShape, bool aPermitDiagonal ) const;
|
BREAKOUT_LIST ovalBreakouts( int aWidth, const SHAPE* aShape, bool aPermitDiagonal ) const;
|
||||||
BREAKOUT_LIST convexBreakouts( int aWidth, const SHAPE* aShape, bool aPermitDiagonal ) const;
|
BREAKOUT_LIST customBreakouts( int aWidth, const ITEM* aItem, bool aPermitDiagonal ) const;
|
||||||
BREAKOUT_LIST computeBreakouts( int aWidth, const ITEM* aItem, bool aPermitDiagonal ) const;
|
BREAKOUT_LIST computeBreakouts( int aWidth, const ITEM* aItem, bool aPermitDiagonal ) const;
|
||||||
|
|
||||||
int smartPadsSingle( LINE* aLine, ITEM* aPad, bool aEnd, int aEndVertex );
|
int smartPadsSingle( LINE* aLine, ITEM* aPad, bool aEnd, int aEndVertex );
|
||||||
|
|
Loading…
Reference in New Issue