mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
Finished porting BoundingBox to XS
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
BoundingBox* clone()
|
||||
%code{% const char* CLASS = "Slic3r::Geometry::BoundingBox"; RETVAL = new BoundingBox(*THIS); %};
|
||||
void merge(BoundingBox* bb) %code{% THIS->merge(*bb); %};
|
||||
void merge_point(Point* point) %code{% THIS->merge(*point); %};
|
||||
void scale(double factor);
|
||||
void translate(double x, double y);
|
||||
Polygon* polygon()
|
||||
@@ -31,7 +32,7 @@
|
||||
%{
|
||||
|
||||
BoundingBox*
|
||||
BoundingBox::new_from_points(CLASS, points)
|
||||
new_from_points(CLASS, points)
|
||||
char* CLASS
|
||||
Points points
|
||||
CODE:
|
||||
@@ -41,3 +42,22 @@ BoundingBox::new_from_points(CLASS, points)
|
||||
|
||||
%}
|
||||
};
|
||||
|
||||
%name{Slic3r::Geometry::BoundingBoxf3} class BoundingBoxf3 {
|
||||
~BoundingBoxf3();
|
||||
BoundingBoxf3* clone()
|
||||
%code{% const char* CLASS = "Slic3r::Geometry::BoundingBoxf3"; RETVAL = new BoundingBoxf3(*THIS); %};
|
||||
void merge(BoundingBoxf3* bb) %code{% THIS->merge(*bb); %};
|
||||
void scale(double factor);
|
||||
void translate(double x, double y, double z);
|
||||
Pointf3* size()
|
||||
%code{% const char* CLASS = "Slic3r::Pointf3"; RETVAL = new Pointf3(THIS->size()); %};
|
||||
Pointf3* center()
|
||||
%code{% const char* CLASS = "Slic3r::Pointf3"; RETVAL = new Pointf3(THIS->center()); %};
|
||||
double x_min() %code{% RETVAL = THIS->min.x; %};
|
||||
double x_max() %code{% RETVAL = THIS->max.x; %};
|
||||
double y_min() %code{% RETVAL = THIS->min.y; %};
|
||||
double y_max() %code{% RETVAL = THIS->max.y; %};
|
||||
double z_min() %code{% RETVAL = THIS->min.z; %};
|
||||
double z_max() %code{% RETVAL = THIS->max.z; %};
|
||||
};
|
||||
|
||||
@@ -49,3 +49,16 @@ Point::coincides_with(point_sv)
|
||||
%}
|
||||
|
||||
};
|
||||
|
||||
%name{Slic3r::Pointf3} class Pointf3 {
|
||||
Pointf3(double _x = 0, double _y = 0, double _z = 0);
|
||||
~Pointf3();
|
||||
Pointf3* clone()
|
||||
%code{% const char* CLASS = "Slic3r::Pointf3"; RETVAL = new Pointf3(*THIS); %};
|
||||
double x()
|
||||
%code{% RETVAL = THIS->x; %};
|
||||
double y()
|
||||
%code{% RETVAL = THIS->y; %};
|
||||
double z()
|
||||
%code{% RETVAL = THIS->z; %};
|
||||
};
|
||||
|
||||
@@ -11,6 +11,7 @@ FullPrintConfig* O_OBJECT
|
||||
ZTable* O_OBJECT
|
||||
TriangleMesh* O_OBJECT
|
||||
Point* O_OBJECT
|
||||
Pointf3* O_OBJECT
|
||||
Line* O_OBJECT
|
||||
Polyline* O_OBJECT
|
||||
PolylineCollection* O_OBJECT
|
||||
@@ -34,6 +35,7 @@ ClipperLib::PolyFillType T_UV
|
||||
|
||||
# we return these types whenever we want the items to be cloned
|
||||
Points T_ARRAYREF
|
||||
Pointfs T_ARRAYREF
|
||||
Lines T_ARRAYREF
|
||||
Polygons T_ARRAYREF
|
||||
Polylines T_ARRAYREF
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
%typemap{SV*};
|
||||
%typemap{AV*};
|
||||
%typemap{Point*};
|
||||
%typemap{Pointf3*};
|
||||
%typemap{BoundingBox*};
|
||||
%typemap{BoundingBoxf3*};
|
||||
%typemap{DynamicPrintConfig*};
|
||||
@@ -25,6 +26,7 @@
|
||||
%typemap{ExtrusionPath*};
|
||||
%typemap{ExtrusionLoop*};
|
||||
%typemap{Points};
|
||||
%typemap{Pointfs};
|
||||
%typemap{Lines};
|
||||
%typemap{Polygons};
|
||||
%typemap{Polylines};
|
||||
|
||||
Reference in New Issue
Block a user