PrusaSlicer-NonPlainar/xs/xsp/Clipper.xsp
Vojtech Bubnik 7ff76d0768 New ClipperUtils functions: opening(), closing() as an alternative
for offset2() with clear meaning.
New ClipperUtils functions: expand(), shrink() as an alternative
for offset() with clear meaning.
All offset values for the new functions are positive.

Various offsetting ClipperUtils (offset, offset2, offset2_ex) working
over Polygons were marked as unsafe, sometimes producing invalid output
if called for more than one polygon. These functions were reworked
to offset polygons one by one. The new functions working over Polygons
shall work the same way as the old safe ones working over ExPolygons,
but working with Polygons shall be computationally more efficient.

Improvements in FDM support generator:
1) For both grid and snug supports: Don't filter out supports for which
   the contacts are completely reduced by support / object XY separation.
2) Rounding / merging of supports using the closing radius parameter is
   now smoother, it does not produce sharp corners.
3) Snug supports: When calculating support interfaces, expand the projected
   support contact areas to produce wider, printable and more stable interfaces.
4) Don't reduce support interfaces for snug supports for steep overhangs,
   that would normally not need them. Snug supports often produce very
   narrow support interface regions and turning them off makes the support
   interfaces disappear.
2021-10-14 09:11:31 +02:00

133 lines
3.4 KiB
Plaintext

%module{Slic3r::XS};
%{
#include <xsinit.h>
#include "libslic3r/ClipperUtils.hpp"
%}
%package{Slic3r::Geometry::Clipper};
%{
IV
_constant()
ALIAS:
JT_MITER = jtMiter
JT_ROUND = jtRound
JT_SQUARE = jtSquare
CODE:
RETVAL = ix;
OUTPUT: RETVAL
Polygons
offset(polygons, delta, joinType = Slic3r::ClipperLib::jtMiter, miterLimit = 3)
Polygons polygons
const float delta
Slic3r::ClipperLib::JoinType joinType
double miterLimit
CODE:
RETVAL = offset(polygons, delta, joinType, miterLimit);
OUTPUT:
RETVAL
ExPolygons
offset_ex(polygons, delta, joinType = Slic3r::ClipperLib::jtMiter, miterLimit = 3)
Polygons polygons
const float delta
Slic3r::ClipperLib::JoinType joinType
double miterLimit
CODE:
RETVAL = offset_ex(polygons, delta, joinType, miterLimit);
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
Polygons
diff(subject, clip, safety_offset = false)
Polygons subject
Polygons clip
bool safety_offset
CODE:
RETVAL = diff(subject, clip, safety_offset ? ApplySafetyOffset::Yes : ApplySafetyOffset::No);
OUTPUT:
RETVAL
ExPolygons
diff_ex(subject, clip, safety_offset = false)
Polygons subject
Polygons clip
bool safety_offset
CODE:
RETVAL = diff_ex(subject, clip, safety_offset ? ApplySafetyOffset::Yes : ApplySafetyOffset::No);
OUTPUT:
RETVAL
Polylines
diff_pl(subject, clip)
Polylines subject
Polygons clip
CODE:
RETVAL = diff_pl(subject, clip);
OUTPUT:
RETVAL
Polygons
intersection(subject, clip, safety_offset = false)
Polygons subject
Polygons clip
bool safety_offset
CODE:
RETVAL = intersection(subject, clip, safety_offset ? ApplySafetyOffset::Yes : ApplySafetyOffset::No);
OUTPUT:
RETVAL
ExPolygons
intersection_ex(subject, clip, safety_offset = false)
Polygons subject
Polygons clip
bool safety_offset
CODE:
RETVAL = intersection_ex(subject, clip, safety_offset ? ApplySafetyOffset::Yes : ApplySafetyOffset::No);
OUTPUT:
RETVAL
Polylines
intersection_pl(subject, clip)
Polylines subject
Polygons clip
CODE:
RETVAL = intersection_pl(subject, clip);
OUTPUT:
RETVAL
Polygons
union(subject, safety_offset = false)
Polygons subject
bool safety_offset
CODE:
RETVAL = safety_offset ? union_safety_offset(subject) : union_(subject);
OUTPUT:
RETVAL
ExPolygons
union_ex(subject, safety_offset = false)
Polygons subject
bool safety_offset
CODE:
RETVAL = safety_offset ? union_safety_offset_ex(subject) : union_ex(subject);
OUTPUT:
RETVAL
%}