mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-09-11 13:18:07 +02:00
initial NFP method with convex polygons working.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user