mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-20 23:31:13 -06:00
Turn ExtrusionLoop into a collection of polylines. Includes some changes to the Polygon API to avoid returning newly allocatd objects
This commit is contained in:
parent
c72dc13d7e
commit
d2d885fc53
11 changed files with 107 additions and 72 deletions
|
@ -9,13 +9,14 @@
|
|||
%name{Slic3r::ExtrusionLoop} class ExtrusionLoop {
|
||||
~ExtrusionLoop();
|
||||
SV* arrayref()
|
||||
%code{% RETVAL = THIS->polygon.to_AV(); %};
|
||||
%code{% Polygon polygon; THIS->polygon(&polygon); RETVAL = polygon.to_AV(); %};
|
||||
SV* pp()
|
||||
%code{% RETVAL = THIS->polygon.to_SV_pureperl(); %};
|
||||
void reverse()
|
||||
%code{% THIS->polygon.reverse(); %};
|
||||
ExtrusionPath* split_at_index(int index);
|
||||
ExtrusionPath* split_at_first_point();
|
||||
%code{% Polygon polygon; THIS->polygon(&polygon); RETVAL = polygon.to_SV_pureperl(); %};
|
||||
void reverse();
|
||||
ExtrusionPath* split_at_index(int index)
|
||||
%code{% RETVAL = new ExtrusionPath (); THIS->split_at_index(index, RETVAL); %};
|
||||
ExtrusionPath* split_at_first_point()
|
||||
%code{% RETVAL = new ExtrusionPath (); THIS->split_at_first_point(RETVAL); %};
|
||||
bool make_counter_clockwise();
|
||||
Clone<Point> first_point();
|
||||
Clone<Point> last_point();
|
||||
|
@ -33,22 +34,25 @@ _new(CLASS, polygon_sv, role, mm3_per_mm, width, height)
|
|||
float width;
|
||||
float height;
|
||||
CODE:
|
||||
RETVAL = new ExtrusionLoop ();
|
||||
RETVAL->polygon.from_SV_check(polygon_sv);
|
||||
RETVAL->role = role;
|
||||
Polygon polygon;
|
||||
polygon.from_SV_check(polygon_sv);
|
||||
RETVAL = new ExtrusionLoop (polygon, role);
|
||||
RETVAL->mm3_per_mm = mm3_per_mm;
|
||||
RETVAL->width = width;
|
||||
RETVAL->height = height;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
Ref<Polygon>
|
||||
Polygon*
|
||||
ExtrusionLoop::polygon(...)
|
||||
CODE:
|
||||
if (items > 1) {
|
||||
THIS->polygon.from_SV_check( ST(1) );
|
||||
Polygon polygon;
|
||||
polygon.from_SV_check( ST(1) );
|
||||
THIS->set_polygon(polygon);
|
||||
}
|
||||
RETVAL = &(THIS->polygon);
|
||||
RETVAL = new Polygon ();
|
||||
THIS->polygon(RETVAL);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
|
|
|
@ -19,12 +19,13 @@
|
|||
void reverse();
|
||||
Lines lines();
|
||||
Polyline* split_at(Point* point)
|
||||
%code{% RETVAL = THIS->split_at(*point); %};
|
||||
%code{% RETVAL = new Polyline(); THIS->split_at(*point, RETVAL); %};
|
||||
Polyline* split_at_index(int index)
|
||||
%code{% RETVAL = THIS->split_at_index(index); %};
|
||||
%code{% RETVAL = new Polyline(); THIS->split_at_index(index, RETVAL); %};
|
||||
Polyline* split_at_first_point()
|
||||
%code{% RETVAL = THIS->split_at_first_point(); %};
|
||||
Points equally_spaced_points(double distance);
|
||||
%code{% RETVAL = new Polyline(); THIS->split_at_first_point(RETVAL); %};
|
||||
Points equally_spaced_points(double distance)
|
||||
%code{% THIS->equally_spaced_points(distance, &RETVAL); %};
|
||||
double length();
|
||||
double area();
|
||||
bool is_counter_clockwise();
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
Lines lines();
|
||||
Clone<Point> first_point();
|
||||
Clone<Point> last_point();
|
||||
Points equally_spaced_points(double distance);
|
||||
Points equally_spaced_points(double distance)
|
||||
%code{% THIS->equally_spaced_points(distance, &RETVAL); %};
|
||||
double length();
|
||||
bool is_valid();
|
||||
void clip_end(double distance);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue