Adding conversion from points to arcs
Allows detection of arcs from segments in a SHAPE_LINE_CHAIN, converting them to SHAPE_ARCs in the chain
This commit is contained in:
parent
5b2be906b8
commit
6c224156f5
|
@ -609,6 +609,13 @@ public:
|
||||||
*/
|
*/
|
||||||
SHAPE_LINE_CHAIN& Simplify( bool aRemoveColinear = true );
|
SHAPE_LINE_CHAIN& Simplify( bool aRemoveColinear = true );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detects arcs in a chain and converts them from segments to true arcs by adding an arc
|
||||||
|
* and the associated references. The original segment points are not changed.
|
||||||
|
* @return reference to self
|
||||||
|
*/
|
||||||
|
SHAPE_LINE_CHAIN& DetectArcs();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert an arc to only a point chain by removing the arc and references.
|
* Convert an arc to only a point chain by removing the arc and references.
|
||||||
*
|
*
|
||||||
|
|
|
@ -223,6 +223,20 @@ bool SHAPE_LINE_CHAIN_BASE::Collide( const SEG& aSeg, int aClearance, int* aActu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SHAPE_LINE_CHAIN& SHAPE_LINE_CHAIN::DetectArcs()
|
||||||
|
{
|
||||||
|
for( int ii = 0; ii < PointCount(); ++ii )
|
||||||
|
{
|
||||||
|
if( ssize_t ind = ArcIndex( ii ) >= 0 )
|
||||||
|
{
|
||||||
|
const SHAPE_ARC& arc = Arc( ind );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const SHAPE_LINE_CHAIN SHAPE_LINE_CHAIN::Reverse() const
|
const SHAPE_LINE_CHAIN SHAPE_LINE_CHAIN::Reverse() const
|
||||||
{
|
{
|
||||||
SHAPE_LINE_CHAIN a( *this );
|
SHAPE_LINE_CHAIN a( *this );
|
||||||
|
|
Loading…
Reference in New Issue