Allow specifying acuracy when appending an arc to a chain

This commit is contained in:
Roberto Fernandez Bautista 2023-01-10 22:22:56 +01:00
parent ee6e86d1db
commit ebce53d574
2 changed files with 8 additions and 1 deletions

View File

@ -529,6 +529,7 @@ public:
void Append( const SHAPE_LINE_CHAIN& aOtherLine );
void Append( const SHAPE_ARC& aArc );
void Append( const SHAPE_ARC& aArc, double aAccuracy );
void Insert( size_t aVertex, const VECTOR2I& aP );

View File

@ -1324,6 +1324,12 @@ void SHAPE_LINE_CHAIN::Append( const SHAPE_LINE_CHAIN& aOtherLine )
void SHAPE_LINE_CHAIN::Append( const SHAPE_ARC& aArc )
{
Append( aArc, SHAPE_ARC::DefaultAccuracyForPCB() );
}
void SHAPE_LINE_CHAIN::Append( const SHAPE_ARC& aArc, double aAccuracy )
{
SEG startToEnd( aArc.GetP0(), aArc.GetP1() );
@ -1335,7 +1341,7 @@ void SHAPE_LINE_CHAIN::Append( const SHAPE_ARC& aArc )
}
else
{
SHAPE_LINE_CHAIN chain = aArc.ConvertToPolyline();
SHAPE_LINE_CHAIN chain = aArc.ConvertToPolyline( aAccuracy );
// @todo should the below 4 LOC be moved to SHAPE_ARC::ConvertToPolyline ?
chain.m_arcs.push_back( aArc );