68 bool s_cw = aPath.
Walkaround( current_obs->m_hull, path_walk, aWindingDirection );
72 snprintf(
name,
sizeof(
name ),
"hull-%s-%d", aWindingDirection ?
"cw" :
"ccw",
m_iteration );
74 snprintf(
name,
sizeof(
name ),
"path-%s-%d", aWindingDirection ?
"cw" :
"ccw",
m_iteration );
76 snprintf(
name,
sizeof(
name ),
"result-%s-%d", aWindingDirection ?
"cw" :
"ccw",
m_iteration );
86 if( current_obs && current_obs->m_hull.PointInside( initialLast ) &&
87 !current_obs->m_hull.PointOnEdge( initialLast ) )
100 LINE path_cw( aInitialPath ), path_ccw( aInitialPath );
115 start( aInitialPath );
120 result.
lineCw = aInitialPath;
138 const int maxWalkDistFactor = 10;
139 long long lengthLimit = aInitialPath.
CLine().
Length() * maxWalkDistFactor;
165 if( path_cw.Line().Length() > lengthLimit && path_ccw.
Line().
Length() > lengthLimit )
212 LINE path_cw( aInitialPath ), path_ccw( aInitialPath );
223 aWalkPath = aInitialPath;
227 start( aInitialPath );
232 aWalkPath = aInitialPath;
247 if( path_cw.PointCount() == 0 )
261 int len_cw = path_cw.CLine().Length();
265 aWalkPath = ( len_cw > len_ccw ? path_cw : path_ccw );
267 aWalkPath = ( len_cw < len_ccw ? path_cw : path_ccw );
278 aWalkPath = path_ccw;
287 int len_cw = path_cw.CLine().Length();
291 aWalkPath = ( len_cw > len_ccw ? path_cw : path_ccw );
293 aWalkPath = ( len_cw < len_ccw ? path_cw : path_ccw );
301 if( aWalkPath.
CPoint( -1 ) != aInitialPath.
CPoint( -1 ) )
const SHAPE_LINE_CHAIN & CLine() const
#define PNS_DBGN(dbg, method)
long long int Length() const
Return length of the line chain in Euclidean metric.
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).
int m_recursiveBlockageCount
SHAPE_LINE_CHAIN & Simplify(bool aRemoveColinear=true)
Simplify the line chain by removing colinear adjacent segments and duplicate vertices.
WALKAROUND_STATUS statusCw
WALKAROUND_STATUS Route(const LINE &aInitialPath, LINE &aWalkPath, bool aOptimize=true)
WALKAROUND_STATUS singleStep(LINE &aPath, bool aWindingDirection)
std::set< ITEM * > m_restrictedSet
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
static bool Optimize(LINE *aLine, int aEffortLevel, NODE *aWorld, const VECTOR2I &aV=VECTOR2I(0, 0))
const VECTOR2I & CPoint(int aIdx) const
void SetShape(const SHAPE_LINE_CHAIN &aLine)
Return the shape of the line.
NODE::OPT_OBSTACLE m_currentObstacle[2]
#define PNS_DBG(dbg, method,...)
DEBUG_DECORATOR * Dbg() const
void start(const LINE &aInitialPath)
bool m_forceSingleDirection
SHAPE_LINE_CHAIN & Line()
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
NODE::OPT_OBSTACLE nearestObstacle(const LINE &aPath)
Reduce corner cost by merging obtuse segments.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
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.
WALKAROUND_STATUS statusCcw
OPT< 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...
Push and Shove diff pair dimensions (gap) settings dialog.