mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 07:41:09 -06:00
New ->scale() method for ExPolygon::XS
This commit is contained in:
parent
5409c27852
commit
e0052b01d3
3 changed files with 24 additions and 1 deletions
|
@ -19,8 +19,24 @@ class ExPolygon
|
|||
Polygon contour;
|
||||
Polygons holes;
|
||||
SV* arrayref();
|
||||
void scale(double factor);
|
||||
};
|
||||
|
||||
#define scale_polygon(poly, factor) \
|
||||
for (Polygon::iterator pit = (poly).begin(); pit != (poly).end(); ++pit) { \
|
||||
(*pit).x *= factor; \
|
||||
(*pit).y *= factor; \
|
||||
}
|
||||
|
||||
void
|
||||
ExPolygon::scale(double factor)
|
||||
{
|
||||
scale_polygon(contour, factor);
|
||||
for (Polygons::iterator it = holes.begin(); it != holes.end(); ++it) {
|
||||
scale_polygon(*it, factor);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
perl2polygon(SV* poly_sv, Polygon& poly)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue