56 int actual_clearance = std::numeric_limits<int>::max();
57 std::vector<const SHAPE*> a_shapes;
58 std::vector<const SHAPE*> b_shapes;
64 if(
Type() == SHAPE_TYPE::SH_POLY_SET )
68 a_shapes.push_back( &polySet->
COutline( 0 ) );
75 if( aOther->
Type() == SHAPE_TYPE::SH_POLY_SET )
79 b_shapes.push_back( &polySet->
COutline( 0 ) );
87 a_shapes.push_back(
this );
90 b_shapes.push_back( aOther );
92 for(
const SHAPE* a : a_shapes )
94 for(
const SHAPE* b : b_shapes )
97 a->Collide( b, std::numeric_limits<int>::max() / 2, &temp_dist );
99 if( temp_dist < actual_clearance )
100 actual_clearance = temp_dist;
104 return actual_clearance;
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
VECTOR2I::extended_type ecoord
virtual size_t GetIndexableSubshapeCount() const
SHAPE_TYPE m_type
< type of our shape
virtual void GetIndexableSubshapes(std::vector< const SHAPE * > &aSubshapes) const
SHAPE_TYPE Type() const
Return the type of the shape.
bool PointInside(const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const override
Check if point aP lies inside a closed shape.
SEG::ecoord SquaredDistance(const VECTOR2I &aP, bool aOutlineOnly=false) const override
Represent a set of closed polygons.
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index.
int OutlineCount() const
Return the number of outlines in the set.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
SHAPE_LINE_CHAIN m_points
void TransformToPolygon(SHAPE_POLY_SET &aBuffer, int aError, ERROR_LOC aErrorLoc) const override
Fills a SHAPE_POLY_SET with a polygon representation of this shape.
An abstract shape on 2D plane.
int GetClearance(const SHAPE *aOther) const
Return the actual minimum distance between two shapes.
virtual void TransformToPolygon(SHAPE_POLY_SET &aBuffer, int aError, ERROR_LOC aErrorLoc) const =0
Fills a SHAPE_POLY_SET with a polygon representation of this shape.
virtual bool Parse(std::stringstream &aStream)
virtual bool PointInside(const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const
Check if point aP lies inside a closed shape.
virtual const std::string Format(bool aCplusPlus=true) const
virtual int Distance(const VECTOR2I &aP) const
Returns the minimum distance from a given point to this shape.
virtual SEG::ecoord SquaredDistance(const VECTOR2I &aP, bool aOutlineOnly=false) const
static constexpr extended_type ECOORD_MAX