Remove unfinished code for handling arcs in SHAPE_POLY_SET::booleanOp

Boolean Ops on polygons with arcs are not supported (the only exception
is Simplify)

Also fix a bug in SHAPE_LINE_CHAIN::splitArc that resulted in an
exception

Partially fixes https://gitlab.com/kicad/code/kicad/-/issues/9380
This commit is contained in:
Roberto Fernandez Bautista 2021-10-13 18:29:32 +01:00
parent 7715d6d396
commit 4b8ca18bf7
2 changed files with 3 additions and 40 deletions

View File

@ -174,6 +174,9 @@ void SHAPE_LINE_CHAIN::splitArc( ssize_t aPtIndex, bool aCoincident )
if( !IsSharedPt( aPtIndex ) && IsArcStart( aPtIndex ) )
return; // Nothing to do
if( !IsPtOnArc( aPtIndex ) )
return; // Nothing to do
wxCHECK_MSG( aPtIndex < static_cast<ssize_t>( m_shapes.size() ), /* void */,
"Invalid point index requested." );

View File

@ -650,46 +650,6 @@ void SHAPE_POLY_SET::booleanOp( ClipperLib::ClipType aType, const SHAPE_POLY_SET
c.Execute( aType, solution, ClipperLib::pftNonZero, ClipperLib::pftNonZero );
importTree( &solution, zValues, arcBuffer );
// amend arcs for the intersection points
for( auto& poly : m_polys )
{
for( size_t i = 0; i < poly.size(); i++ )
{
for( int j = 0; j < poly[i].PointCount(); j++ )
{
const VECTOR2I& pt = poly[i].CPoint( j );
if( newIntersectPoints.find( pt ) != newIntersectPoints.end() )
{
const std::pair<ssize_t, ssize_t>& shape = poly[i].CShapes()[j];
CLIPPER_Z_VALUE zval = newIntersectPoints.at( pt );
// Fixup arc end points to match the new intersection points found in clipper
// @todo consider editing the intersection point to be the "true" arc
// intersection.
if( poly[i].IsSharedPt( j ) )
{
poly[i].amendArcEnd( shape.first, pt );
poly[i].amendArcStart( shape.second, pt );
}
else if( poly[i].IsArcStart( j ) )
{
poly[i].amendArcStart( shape.first, pt );
}
else if( poly[i].IsArcEnd( j ) )
{
poly[i].amendArcEnd( shape.first, pt );
}
else
{
poly[i].splitArc( j );
}
}
}
}
}
}