router: first insert intersections, then build graph in Walkaround()
This commit is contained in:
parent
61e75a838b
commit
24574aa2f5
|
@ -219,6 +219,19 @@ bool LINE::Walkaround( const SHAPE_LINE_CHAIN& aObstacle, SHAPE_LINE_CHAIN& aPat
|
|||
return nullptr;
|
||||
};
|
||||
|
||||
// make sure all points that lie on the edge of the hull also exist as vertices in the path
|
||||
for( int i = 0; i < pnew.PointCount(); i++ )
|
||||
{
|
||||
const VECTOR2I &p = pnew.CPoint(i);
|
||||
|
||||
if( hnew.PointOnEdge( p ) )
|
||||
{
|
||||
SHAPE_LINE_CHAIN::INTERSECTION ip;
|
||||
ip.p = p;
|
||||
ips.push_back( ip );
|
||||
}
|
||||
}
|
||||
|
||||
// insert all intersections found into the new hull/path SLCs
|
||||
for( auto ip : ips )
|
||||
{
|
||||
|
@ -235,19 +248,6 @@ bool LINE::Walkaround( const SHAPE_LINE_CHAIN& aObstacle, SHAPE_LINE_CHAIN& aPat
|
|||
}
|
||||
}
|
||||
|
||||
// make sure all points that lie on the edge of the hull also exist as vertices in the path
|
||||
for( int i = 0; i < pnew.PointCount(); i++ )
|
||||
{
|
||||
const VECTOR2I &p = pnew.CPoint(i);
|
||||
|
||||
if( hnew.PointOnEdge( p ) )
|
||||
{
|
||||
SHAPE_LINE_CHAIN::INTERSECTION ip;
|
||||
ip.p = p;
|
||||
ips.push_back( ip );
|
||||
}
|
||||
}
|
||||
|
||||
// we assume the default orientation of the hulls is clockwise, so just reverse the vertex
|
||||
// order if the caller wants a counter-clockwise walkaround
|
||||
if ( !aCw )
|
||||
|
|
Loading…
Reference in New Issue