mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-20 23:31:13 -06:00
Use Clipper for line clipping
This commit is contained in:
parent
1d6a18071a
commit
3025c77675
20 changed files with 202 additions and 211 deletions
|
@ -91,6 +91,15 @@ diff_ex(subject, clip, safety_offset = false)
|
|||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
Polylines
|
||||
diff_pl(subject, clip)
|
||||
Polylines subject
|
||||
Polygons clip
|
||||
CODE:
|
||||
diff(subject, clip, RETVAL);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
Polygons
|
||||
intersection(subject, clip, safety_offset = false)
|
||||
Polygons subject
|
||||
|
@ -111,6 +120,15 @@ intersection_ex(subject, clip, safety_offset = false)
|
|||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
Polylines
|
||||
intersection_pl(subject, clip)
|
||||
Polylines subject
|
||||
Polygons clip
|
||||
CODE:
|
||||
intersection(subject, clip, RETVAL);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
ExPolygons
|
||||
xor_ex(subject, clip, safety_offset = false)
|
||||
Polygons subject
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->midpoint(); %};
|
||||
Point* point_at(double distance)
|
||||
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->point_at(distance); %};
|
||||
Polyline* as_polyline()
|
||||
%code{% const char* CLASS = "Slic3r::Polyline"; RETVAL = new Polyline(); RETVAL->points.push_back(THIS->a); RETVAL->points.push_back(THIS->b); %};
|
||||
%{
|
||||
|
||||
Line*
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
%code{% const char* CLASS = "Slic3r::Polyline::Collection"; RETVAL = THIS->chained_path_from(start_near, no_reverse); %};
|
||||
int count()
|
||||
%code{% RETVAL = THIS->polylines.size(); %};
|
||||
Point* leftmost_point()
|
||||
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->leftmost_point(); %};
|
||||
%{
|
||||
|
||||
PolylineCollection*
|
||||
|
|
|
@ -22,6 +22,7 @@ ClipperLib::PolyFillType T_UV
|
|||
Points T_ARRAYREF
|
||||
Lines T_ARRAYREF
|
||||
Polygons T_ARRAYREF
|
||||
Polylines T_ARRAYREF
|
||||
ExPolygons T_ARRAYREF
|
||||
|
||||
# we return these types whenever we want the items to be returned
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
%typemap{Points};
|
||||
%typemap{Lines};
|
||||
%typemap{Polygons};
|
||||
%typemap{Polylines};
|
||||
%typemap{ExPolygons};
|
||||
%typemap{Polygons*};
|
||||
%typemap{TriangleMeshPtrs};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue