Ported union() to XS
This commit is contained in:
parent
fa07c512b4
commit
94ca28644e
4 changed files with 16 additions and 14 deletions
|
@ -271,11 +271,14 @@ void xor_ex(Slic3r::Polygons &subject, Slic3r::Polygons &clip, Slic3r::ExPolygon
|
|||
_clipper(ClipperLib::ctXor, subject, clip, retval, safety_offset);
|
||||
}
|
||||
|
||||
void union_ex(Slic3r::Polygons &subject, Slic3r::ExPolygons &retval, bool safety_offset)
|
||||
template <class T>
|
||||
void union_(Slic3r::Polygons &subject, T &retval, bool safety_offset)
|
||||
{
|
||||
Slic3r::Polygons p;
|
||||
_clipper(ClipperLib::ctUnion, subject, p, retval, safety_offset);
|
||||
}
|
||||
template void union_<Slic3r::ExPolygons>(Slic3r::Polygons &subject, Slic3r::ExPolygons &retval, bool safety_offset);
|
||||
template void union_<Slic3r::Polygons>(Slic3r::Polygons &subject, Slic3r::Polygons &retval, bool safety_offset);
|
||||
|
||||
void simplify_polygons(Slic3r::Polygons &subject, Slic3r::Polygons &retval)
|
||||
{
|
||||
|
|
|
@ -60,7 +60,8 @@ void intersection(Slic3r::Polygons &subject, Slic3r::Polygons &clip, T &retval,
|
|||
void xor_ex(Slic3r::Polygons &subject, Slic3r::Polygons &clip, Slic3r::ExPolygons &retval,
|
||||
bool safety_offset = false);
|
||||
|
||||
void union_ex(Slic3r::Polygons &subject, Slic3r::ExPolygons &retval, bool safety_offset = false);
|
||||
template <class T>
|
||||
void union_(Slic3r::Polygons &subject, T &retval, bool safety_offset = false);
|
||||
|
||||
void simplify_polygons(Slic3r::Polygons &subject, Slic3r::Polygons &retval);
|
||||
|
||||
|
|
|
@ -110,12 +110,21 @@ xor_ex(subject, clip, safety_offset = false)
|
|||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
Polygons
|
||||
union(subject, safety_offset = false)
|
||||
Polygons subject
|
||||
bool safety_offset
|
||||
CODE:
|
||||
union_(subject, RETVAL, safety_offset);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
ExPolygons
|
||||
union_ex(subject, safety_offset = false)
|
||||
Polygons subject
|
||||
bool safety_offset
|
||||
CODE:
|
||||
union_ex(subject, RETVAL, safety_offset);
|
||||
union_(subject, RETVAL, safety_offset);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue