PrusaSlicer-NonPlainar/xs/xsp/Clipper.xsp

113 lines
2.8 KiB
Plaintext
Raw Normal View History

%module{Slic3r::XS};
%{
#include <xsinit.h>
#include "libslic3r/ClipperUtils.hpp"
%}
%package{Slic3r::Geometry::Clipper};
%{
2013-08-26 23:26:44 +00:00
IV
_constant()
ALIAS:
JT_MITER = jtMiter
JT_ROUND = jtRound
JT_SQUARE = jtSquare
CODE:
RETVAL = ix;
OUTPUT: RETVAL
2013-07-16 22:48:29 +00:00
Polygons
offset(polygons, delta, joinType = Slic3r::ClipperLib::jtMiter, miterLimit = 3)
2013-07-16 22:48:29 +00:00
Polygons polygons
const float delta
Slic3r::ClipperLib::JoinType joinType
2013-07-16 22:48:29 +00:00
double miterLimit
CODE:
RETVAL = offset(polygons, delta, joinType, miterLimit);
2013-07-16 22:48:29 +00:00
OUTPUT:
RETVAL
ExPolygons
offset2_ex(polygons, delta1, delta2, joinType = Slic3r::ClipperLib::jtMiter, miterLimit = 3)
Polygons polygons
const float delta1
const float delta2
Slic3r::ClipperLib::JoinType joinType
double miterLimit
CODE:
RETVAL = offset2_ex(union_ex(polygons), delta1, delta2, joinType, miterLimit);
OUTPUT:
RETVAL
2013-07-16 23:21:30 +00:00
Polygons
diff(subject, clip, safety_offset = false)
Polygons subject
Polygons clip
bool safety_offset
CODE:
2021-05-05 11:27:00 +00:00
RETVAL = diff(subject, clip, safety_offset ? ApplySafetyOffset::Yes : ApplySafetyOffset::No);
2013-07-16 23:21:30 +00:00
OUTPUT:
RETVAL
2013-07-16 18:29:15 +00:00
ExPolygons
diff_ex(subject, clip, safety_offset = false)
Polygons subject
Polygons clip
bool safety_offset
CODE:
2021-05-05 11:27:00 +00:00
RETVAL = diff_ex(subject, clip, safety_offset ? ApplySafetyOffset::Yes : ApplySafetyOffset::No);
2013-07-16 23:21:30 +00:00
OUTPUT:
RETVAL
2013-11-21 13:15:38 +00:00
Polylines
diff_pl(subject, clip)
Polylines subject
Polygons clip
CODE:
RETVAL = diff_pl(subject, clip);
OUTPUT:
RETVAL
2013-07-16 23:21:30 +00:00
Polygons
intersection(subject, clip, safety_offset = false)
Polygons subject
Polygons clip
bool safety_offset
CODE:
2021-05-05 11:27:00 +00:00
RETVAL = intersection(subject, clip, safety_offset ? ApplySafetyOffset::Yes : ApplySafetyOffset::No);
2013-07-16 18:29:15 +00:00
OUTPUT:
RETVAL
ExPolygons
intersection_ex(subject, clip, safety_offset = false)
Polygons subject
Polygons clip
bool safety_offset
CODE:
2021-05-05 11:27:00 +00:00
RETVAL = intersection_ex(subject, clip, safety_offset ? ApplySafetyOffset::Yes : ApplySafetyOffset::No);
OUTPUT:
RETVAL
2013-08-17 10:24:04 +00:00
Polygons
union(subject, safety_offset = false)
Polygons subject
bool safety_offset
CODE:
2021-05-05 11:27:00 +00:00
RETVAL = safety_offset ? union_safety_offset(subject) : union_(subject);
2013-08-17 10:24:04 +00:00
OUTPUT:
RETVAL
ExPolygons
union_ex(subject, safety_offset = false)
Polygons subject
bool safety_offset
CODE:
2021-05-05 11:27:00 +00:00
RETVAL = safety_offset ? union_safety_offset_ex(subject) : union_ex(subject);
2013-08-26 16:37:19 +00:00
OUTPUT:
RETVAL
%}