2013-07-16 18:09:53 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
2015-12-07 23:39:54 +00:00
|
|
|
#include <xsinit.h>
|
2013-07-16 18:09:53 +00:00
|
|
|
#include "clipper.hpp"
|
2014-08-03 17:42:29 +00:00
|
|
|
#include "libslic3r/ClipperUtils.hpp"
|
2013-07-16 18:09:53 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
%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
|
2016-11-28 16:33:17 +00:00
|
|
|
offset(polygons, delta, joinType = ClipperLib::jtMiter, miterLimit = 3)
|
2013-07-16 22:48:29 +00:00
|
|
|
Polygons polygons
|
|
|
|
const float delta
|
|
|
|
ClipperLib::JoinType joinType
|
|
|
|
double miterLimit
|
|
|
|
CODE:
|
2016-12-13 18:22:23 +00:00
|
|
|
RETVAL = offset(polygons, delta, joinType, miterLimit);
|
2013-07-16 22:48:29 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-16 18:09:53 +00:00
|
|
|
ExPolygons
|
2016-11-28 16:33:17 +00:00
|
|
|
offset_ex(polygons, delta, joinType = ClipperLib::jtMiter, miterLimit = 3)
|
2013-07-16 18:09:53 +00:00
|
|
|
Polygons polygons
|
|
|
|
const float delta
|
|
|
|
ClipperLib::JoinType joinType
|
|
|
|
double miterLimit
|
|
|
|
CODE:
|
2016-12-13 18:22:23 +00:00
|
|
|
RETVAL = offset_ex(polygons, delta, joinType, miterLimit);
|
2013-07-16 18:09:53 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-16 22:48:29 +00:00
|
|
|
Polygons
|
2016-11-28 16:33:17 +00:00
|
|
|
offset2(polygons, delta1, delta2, joinType = ClipperLib::jtMiter, miterLimit = 3)
|
2013-07-16 22:48:29 +00:00
|
|
|
Polygons polygons
|
|
|
|
const float delta1
|
|
|
|
const float delta2
|
|
|
|
ClipperLib::JoinType joinType
|
|
|
|
double miterLimit
|
|
|
|
CODE:
|
2016-12-13 18:22:23 +00:00
|
|
|
RETVAL = offset2(polygons, delta1, delta2, joinType, miterLimit);
|
2013-07-16 22:48:29 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-16 18:09:53 +00:00
|
|
|
ExPolygons
|
2016-11-28 16:33:17 +00:00
|
|
|
offset2_ex(polygons, delta1, delta2, joinType = ClipperLib::jtMiter, miterLimit = 3)
|
2013-07-16 18:09:53 +00:00
|
|
|
Polygons polygons
|
|
|
|
const float delta1
|
|
|
|
const float delta2
|
|
|
|
ClipperLib::JoinType joinType
|
|
|
|
double miterLimit
|
|
|
|
CODE:
|
2016-12-13 18:22:23 +00:00
|
|
|
RETVAL = offset2_ex(polygons, delta1, delta2, joinType, miterLimit);
|
2013-07-16 18:09:53 +00:00
|
|
|
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:
|
2016-12-13 18:22:23 +00:00
|
|
|
RETVAL = diff(subject, clip, safety_offset);
|
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:
|
2016-12-13 18:22:23 +00:00
|
|
|
RETVAL = diff_ex(subject, clip, safety_offset);
|
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:
|
2016-12-13 18:22:23 +00:00
|
|
|
RETVAL = diff_pl(subject, clip);
|
2014-05-08 09:07:37 +00:00
|
|
|
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:
|
2016-12-13 18:22:23 +00:00
|
|
|
RETVAL = intersection(subject, clip, safety_offset);
|
2013-07-16 18:29:15 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-16 22:29:09 +00:00
|
|
|
ExPolygons
|
|
|
|
intersection_ex(subject, clip, safety_offset = false)
|
|
|
|
Polygons subject
|
|
|
|
Polygons clip
|
|
|
|
bool safety_offset
|
|
|
|
CODE:
|
2016-12-13 18:22:23 +00:00
|
|
|
RETVAL = intersection_ex(subject, clip, safety_offset);
|
2013-07-16 22:29:09 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-11-21 13:15:38 +00:00
|
|
|
Polylines
|
|
|
|
intersection_pl(subject, clip)
|
|
|
|
Polylines subject
|
|
|
|
Polygons clip
|
|
|
|
CODE:
|
2016-12-13 18:22:23 +00:00
|
|
|
RETVAL = intersection_pl(subject, clip);
|
2013-07-16 22:29:09 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-08-17 10:24:04 +00:00
|
|
|
Polygons
|
|
|
|
union(subject, safety_offset = false)
|
|
|
|
Polygons subject
|
|
|
|
bool safety_offset
|
|
|
|
CODE:
|
2016-12-13 18:22:23 +00:00
|
|
|
RETVAL = union_(subject, safety_offset);
|
2013-08-17 10:24:04 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-16 22:29:09 +00:00
|
|
|
ExPolygons
|
|
|
|
union_ex(subject, safety_offset = false)
|
|
|
|
Polygons subject
|
|
|
|
bool safety_offset
|
|
|
|
CODE:
|
2016-12-13 18:22:23 +00:00
|
|
|
RETVAL = union_ex(subject, safety_offset);
|
2013-08-26 16:37:19 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-07-16 18:09:53 +00:00
|
|
|
%}
|