initial NFP method with convex polygons working.

This commit is contained in:
tamasmeszaros
2018-06-05 12:02:45 +02:00
parent fd829580e9
commit 34c850fa9d
23 changed files with 3864 additions and 773 deletions
@@ -46,10 +46,25 @@ std::string ShapeLike::toString(const PolygonImpl& sh)
return ss.str();
}
template<> PolygonImpl ShapeLike::create( std::initializer_list< PointImpl > il)
template<> PolygonImpl ShapeLike::create( const PathImpl& path )
{
PolygonImpl p;
p.Contour = il;
p.Contour = path;
// Expecting that the coordinate system Y axis is positive in upwards
// direction
if(ClipperLib::Orientation(p.Contour)) {
// Not clockwise then reverse the b*tch
ClipperLib::ReversePath(p.Contour);
}
return p;
}
template<> PolygonImpl ShapeLike::create( PathImpl&& path )
{
PolygonImpl p;
p.Contour.swap(path);
// Expecting that the coordinate system Y axis is positive in upwards
// direction