67 for(
auto item : aSet )
69 if(
auto solid = dyn_cast<SOLID*>( item ) )
79 std::optional<OBSTACLE>& current_obs =
89 bool s_cw = aPath.
Walkaround( current_obs->m_hull, path_walk, aWindingDirection );
103 if( current_obs && current_obs->m_hull.PointInside( initialLast ) &&
104 !current_obs->m_hull.PointOnEdge( initialLast ) )
117 LINE path_cw( aInitialPath ), path_ccw( aInitialPath );
132 start( aInitialPath );
136 result.
lineCw = aInitialPath;
149 const int maxWalkDistFactor = 10;
150 long long lengthLimit = aInitialPath.
CLine().
Length() * maxWalkDistFactor;
226 LINE path_cw( aInitialPath ), path_ccw( aInitialPath );
237 aWalkPath = aInitialPath;
241 start( aInitialPath );
245 aWalkPath = aInitialPath;
255 if( path_cw.PointCount() == 0 )
269 int len_cw = path_cw.CLine().Length();
273 aWalkPath = ( len_cw > len_ccw ? path_cw : path_ccw );
275 aWalkPath = ( len_cw < len_ccw ? path_cw : path_ccw );
286 aWalkPath = path_ccw;
295 int len_cw = path_cw.CLine().Length();
299 aWalkPath = ( len_cw > len_ccw ? path_cw : path_ccw );
301 aWalkPath = ( len_cw < len_ccw ? path_cw : path_ccw );
309 if( aWalkPath.
CPoint( -1 ) != aInitialPath.
CPoint( -1 ) )
DEBUG_DECORATOR * Dbg() const
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
const VECTOR2I & CPoint(int aIdx) const
void SetShape(const SHAPE_LINE_CHAIN &aLine)
Return the shape of the line.
const SHAPE_LINE_CHAIN & CLine() const
SHAPE_LINE_CHAIN & Line()
bool Walkaround(SHAPE_LINE_CHAIN aObstacle, SHAPE_LINE_CHAIN &aPre, SHAPE_LINE_CHAIN &aWalk, SHAPE_LINE_CHAIN &aPost, bool aCw) const
Calculate a line tightly wrapping a convex hull of an obstacle object (aObstacle).
virtual void ClearLinks()
Return the number of segments that were assembled together to form this line.
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
OPT_OBSTACLE NearestObstacle(const LINE *aLine, int aKindMask=ITEM::ANY_T, const std::set< ITEM * > *aRestrictedSet=nullptr, bool aUseClearanceEpsilon=true)
Follow the line in search of an obstacle that is nearest to the starting to the line's starting point...
static bool Optimize(LINE *aLine, int aEffortLevel, NODE *aWorld, const VECTOR2I &aV=VECTOR2I(0, 0))
@ MERGE_OBTUSE
Reduce corner cost by merging obtuse segments.
std::set< ITEM * > m_restrictedSet
WALKAROUND_STATUS singleStep(LINE &aPath, bool aWindingDirection)
NODE::OPT_OBSTACLE m_currentObstacle[2]
NODE::OPT_OBSTACLE nearestObstacle(const LINE &aPath)
std::vector< VECTOR2I > m_restrictedVertices
WALKAROUND_STATUS Route(const LINE &aInitialPath, LINE &aWalkPath, bool aOptimize=true)
void start(const LINE &aInitialPath)
void RestrictToSet(bool aEnabled, const std::set< ITEM * > &aSet)
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
SHAPE_LINE_CHAIN & Simplify(bool aRemoveColinear=true)
Simplify the line chain by removing colinear adjacent segments and duplicate vertices.
long long int Length() const
Return length of the line chain in Euclidean metric.
Push and Shove diff pair dimensions (gap) settings dialog.
#define PNS_DBG(dbg, method,...)
#define PNS_DBGN(dbg, method)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
WALKAROUND_STATUS statusCcw
WALKAROUND_STATUS statusCw