mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 20:03:47 +00:00
Ported Slic3r::Surface to XS
This commit is contained in:
90
xs/xsp/Surface.xsp
Normal file
90
xs/xsp/Surface.xsp
Normal file
@@ -0,0 +1,90 @@
|
||||
%module{Slic3r::XS};
|
||||
|
||||
%{
|
||||
#include <myinit.h>
|
||||
#include "Surface.hpp"
|
||||
%}
|
||||
|
||||
%name{Slic3r::Surface} class Surface {
|
||||
%name{_clone} Surface(Surface& self);
|
||||
~Surface();
|
||||
ExPolygon* expolygon()
|
||||
%code{% const char* CLASS = "Slic3r::ExPolygon::XS"; RETVAL = new ExPolygon(THIS->expolygon); %};
|
||||
double thickness()
|
||||
%code{% RETVAL = THIS->thickness; %};
|
||||
unsigned short thickness_layers()
|
||||
%code{% RETVAL = THIS->thickness_layers; %};
|
||||
%{
|
||||
|
||||
Surface*
|
||||
_new(CLASS, expolygon, surface_type, thickness, thickness_layers, bridge_angle, extra_perimeters)
|
||||
char* CLASS;
|
||||
ExPolygon* expolygon;
|
||||
SurfaceType surface_type;
|
||||
double thickness;
|
||||
unsigned short thickness_layers;
|
||||
double bridge_angle;
|
||||
unsigned short extra_perimeters;
|
||||
CODE:
|
||||
RETVAL = new Surface ();
|
||||
RETVAL->expolygon = *expolygon;
|
||||
RETVAL->surface_type = surface_type;
|
||||
RETVAL->thickness = thickness;
|
||||
RETVAL->thickness_layers = thickness_layers;
|
||||
RETVAL->bridge_angle = bridge_angle;
|
||||
RETVAL->extra_perimeters = extra_perimeters;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
SurfaceType
|
||||
Surface::surface_type(...)
|
||||
CODE:
|
||||
if (items > 1) {
|
||||
THIS->surface_type = (SurfaceType)SvUV(ST(1));
|
||||
}
|
||||
RETVAL = THIS->surface_type;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
double
|
||||
Surface::bridge_angle(...)
|
||||
CODE:
|
||||
if (items > 1) {
|
||||
THIS->bridge_angle = (double)SvNV(ST(1));
|
||||
}
|
||||
RETVAL = THIS->bridge_angle;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
unsigned short
|
||||
Surface::extra_perimeters(...)
|
||||
CODE:
|
||||
if (items > 1) {
|
||||
THIS->extra_perimeters = (double)SvUV(ST(1));
|
||||
}
|
||||
RETVAL = THIS->extra_perimeters;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
%}
|
||||
};
|
||||
|
||||
%package{Slic3r::Surface};
|
||||
%{
|
||||
|
||||
IV
|
||||
_constant()
|
||||
ALIAS:
|
||||
S_TYPE_TOP = stTop
|
||||
S_TYPE_BOTTOM = stBottom
|
||||
S_TYPE_INTERNAL = stInternal
|
||||
S_TYPE_INTERNALSOLID = stInternalSolid
|
||||
S_TYPE_INTERNALBRIDGE = stInternalBridge
|
||||
S_TYPE_INTERNALVOID = stInternalVoid
|
||||
PROTOTYPE:
|
||||
CODE:
|
||||
RETVAL = ix;
|
||||
OUTPUT: RETVAL
|
||||
|
||||
%}
|
||||
|
||||
@@ -3,3 +3,5 @@ TriangleMesh* O_OBJECT
|
||||
Point* O_OBJECT
|
||||
ExPolygon* O_OBJECT
|
||||
ExPolygonCollection* O_OBJECT
|
||||
SurfaceType T_UV
|
||||
Surface* O_OBJECT
|
||||
|
||||
@@ -2,4 +2,11 @@
|
||||
%typemap{std::vector<unsigned int>*};
|
||||
%typemap{SV*};
|
||||
%typemap{AV*};
|
||||
%typemap{Point*};
|
||||
%typemap{Point*};
|
||||
%typemap{ExPolygon*};
|
||||
%typemap{SurfaceType}{parsed}{
|
||||
%cpp_type{SurfaceType};
|
||||
%precall_code{%
|
||||
$CVar = (SurfaceType)SvUV($PerlVar);
|
||||
%};
|
||||
};
|
||||
Reference in New Issue
Block a user