47 aOther->
Hole()->
Collide(
Hole(), hole2holeClearance, &elementForces[nf++] );
55 for(
size_t i = 0; i < nf; i++ )
58 force = elementForces[i];
63 return ( force !=
VECTOR2I( 0, 0 ) );
67 int aCollisionMask,
int aMaxIterations )
76 while( iter < aMaxIterations )
84 bool collFound = mv.
PushoutForce( aNode, obs->m_item, force );
98 const int threshold =
Diameter() / 4;
104 if( iter > aMaxIterations / 2 && forceMag > threshold )
115 PNS_DBG( dbg, AddShape, &ff,
YELLOW, 100000,
"via-force-lead" );
122 if( forceMag > threshold )
124 force.
Resize( threshold );
135 PNS_DBG( dbg, AddShape, &ff,
WHITE, 100000,
"via-force-coll" );
141 if( iter == aMaxIterations )
144 PNS_DBG( dbg, AddPoint, (
Pos() + totalForce ),
WHITE, 1000000,
"via-force-new" );
154 int cl = ( aClearance + aWalkaroundThickness / 2 );
163 cl, ( 2 * cl + width ) * ( 1.0 - M_SQRT1_2 ) );
169 int cl = ( aClearance + aWalkaroundThickness / 2 );
174 ( 2 * cl + width ) * ( 1.0 - M_SQRT1_2 ) );
202 if ( aOther->
Pos() !=
Pos() )
226 std::stringstream ss;
std::optional< BOX2I > OPT_BOX2I
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Base class for PNS router board items.
void SetLayers(const LAYER_RANGE &aLayers)
virtual const std::string Format() const
virtual const SHAPE * Hole() const
virtual const SHAPE * Shape() const
Return the geometrical shape of the item.
const LAYER_RANGE & Layers() const
Keep the router "world" - i.e.
COLLISION_QUERY_SCOPE GetCollisionQueryScope() const
int GetClearance(const ITEM *aA, const ITEM *aB, bool aUseClearanceEpsilon=true) const
@ CQS_ALL_RULES
check all rules
OPT_OBSTACLE CheckColliding(const ITEM *aItem, int aKindMask=ITEM::ANY_T)
Check if the item collides with anything else in the world, and if found, returns the obstacle.
std::optional< OBSTACLE > OPT_OBSTACLE
int GetHoleToHoleClearance(const ITEM *aA, const ITEM *aB, bool aUseClearanceEpsilon=true) const
Return the pre-set worst case clearance between any pair of items.
int GetHoleClearance(const ITEM *aA, const ITEM *aB, bool aUseClearanceEpsilon=true) const
virtual DEBUG_DECORATOR * GetDebugDecorator()=0
virtual bool IsFlashedOnLayer(const PNS::ITEM *aItem, int aLayer) const =0
ROUTER_IFACE * GetInterface() const
static ROUTER * GetInstance()
OPT_BOX2I ChangedArea(const VIA *aOther) const
const VECTOR2I & Pos() const
const SHAPE * Shape() const override
Return the geometrical shape of the item.
const SHAPE_LINE_CHAIN HoleHull(int aClearance=0, int aWalkaroundThickness=0, int aLayer=-1) const override
const VIA_HANDLE MakeHandle() const
virtual const std::string Format() const override
bool PushoutForce(NODE *aNode, const VECTOR2I &aDirection, VECTOR2I &aForce, int aCollisionMask=ITEM::ANY_T, int aMaxIterations=10)
void SetPos(const VECTOR2I &aPos)
const SHAPE_LINE_CHAIN Hull(int aClearance=0, int aWalkaroundThickness=0, int aLayer=-1) const override
const SHAPE_CIRCLE * Hole() const override
VIA * Clone() const override
Return a deep copy of the item.
virtual const std::string Format(bool aCplusPlus=true) const override
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
Check if the boundary of shape (this) lies closer to the point aP than aClearance,...
virtual const BOX2I BBox(int aClearance=0) const =0
Compute a bounding box of the shape, with a margin of aClearance a collision.
extended_type SquaredEuclideanNorm() const
Compute the squared euclidean norm of the vector, which is defined as (x ** 2 + y ** 2).
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
VECTOR2< T > Resize(T aNewLength) const
Return a vector of the same direction, but length specified in aNewLength.
Push and Shove diff pair dimensions (gap) settings dialog.
const SHAPE_LINE_CHAIN OctagonalHull(const VECTOR2I &aP0, const VECTOR2I &aSize, int aClearance, int aChamfer)
#define PNS_DBG(dbg, method,...)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.