diff --git a/libs/kimath/src/geometry/shape_line_chain.cpp b/libs/kimath/src/geometry/shape_line_chain.cpp index b554fd0838..bfc29829ec 100644 --- a/libs/kimath/src/geometry/shape_line_chain.cpp +++ b/libs/kimath/src/geometry/shape_line_chain.cpp @@ -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( m_shapes.size() ), /* void */, "Invalid point index requested." ); diff --git a/libs/kimath/src/geometry/shape_poly_set.cpp b/libs/kimath/src/geometry/shape_poly_set.cpp index 3b4c28f4b8..0c0053cbae 100644 --- a/libs/kimath/src/geometry/shape_poly_set.cpp +++ b/libs/kimath/src/geometry/shape_poly_set.cpp @@ -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& 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 ); - } - } - } - } - - } }