Remove any Perl related code from libslic3r

This commit is contained in:
Alessandro Ranellucci 2015-12-08 00:39:54 +01:00
parent 3fac8cd77e
commit 4913e90e10
105 changed files with 907 additions and 1066 deletions

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/Point.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/BridgeDetector.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "clipper.hpp"
#include "libslic3r/ClipperUtils.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/PrintConfig.hpp"
%}
@ -9,12 +9,18 @@
DynamicPrintConfig();
~DynamicPrintConfig();
bool has(t_config_option_key opt_key);
SV* as_hash();
SV* get(t_config_option_key opt_key);
SV* get_at(t_config_option_key opt_key, int i);
bool set(t_config_option_key opt_key, SV* value);
bool set_deserialize(t_config_option_key opt_key, SV* str);
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false);
SV* as_hash()
%code{% RETVAL = ConfigBase__as_hash(THIS); %};
SV* get(t_config_option_key opt_key)
%code{% RETVAL = ConfigBase__get(THIS, opt_key); %};
SV* get_at(t_config_option_key opt_key, int i)
%code{% RETVAL = ConfigBase__get_at(THIS, opt_key, i); %};
bool set(t_config_option_key opt_key, SV* value)
%code{% RETVAL = ConfigBase__set(THIS, opt_key, value); %};
bool set_deserialize(t_config_option_key opt_key, SV* str)
%code{% RETVAL = ConfigBase__set_deserialize(THIS, opt_key, str); %};
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false)
%code{% ConfigBase__set_ifndef(THIS, opt_key, value, deserialize); %};
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}
@ -38,12 +44,18 @@
GCodeConfig();
~GCodeConfig();
bool has(t_config_option_key opt_key);
SV* as_hash();
SV* get(t_config_option_key opt_key);
SV* get_at(t_config_option_key opt_key, int i);
bool set(t_config_option_key opt_key, SV* value);
bool set_deserialize(t_config_option_key opt_key, SV* str);
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false);
SV* as_hash()
%code{% RETVAL = ConfigBase__as_hash(THIS); %};
SV* get(t_config_option_key opt_key)
%code{% RETVAL = ConfigBase__get(THIS, opt_key); %};
SV* get_at(t_config_option_key opt_key, int i)
%code{% RETVAL = ConfigBase__get_at(THIS, opt_key, i); %};
bool set(t_config_option_key opt_key, SV* value)
%code{% RETVAL = StaticConfig__set(THIS, opt_key, value); %};
bool set_deserialize(t_config_option_key opt_key, SV* str)
%code{% RETVAL = ConfigBase__set_deserialize(THIS, opt_key, str); %};
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false)
%code{% ConfigBase__set_ifndef(THIS, opt_key, value, deserialize); %};
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}
@ -61,12 +73,18 @@
PrintConfig();
~PrintConfig();
bool has(t_config_option_key opt_key);
SV* as_hash();
SV* get(t_config_option_key opt_key);
SV* get_at(t_config_option_key opt_key, int i);
bool set(t_config_option_key opt_key, SV* value);
bool set_deserialize(t_config_option_key opt_key, SV* str);
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false);
SV* as_hash()
%code{% RETVAL = ConfigBase__as_hash(THIS); %};
SV* get(t_config_option_key opt_key)
%code{% RETVAL = ConfigBase__get(THIS, opt_key); %};
SV* get_at(t_config_option_key opt_key, int i)
%code{% RETVAL = ConfigBase__get_at(THIS, opt_key, i); %};
bool set(t_config_option_key opt_key, SV* value)
%code{% RETVAL = StaticConfig__set(THIS, opt_key, value); %};
bool set_deserialize(t_config_option_key opt_key, SV* str)
%code{% RETVAL = ConfigBase__set_deserialize(THIS, opt_key, str); %};
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false)
%code{% ConfigBase__set_ifndef(THIS, opt_key, value, deserialize); %};
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}
@ -83,12 +101,18 @@
PrintRegionConfig();
~PrintRegionConfig();
bool has(t_config_option_key opt_key);
SV* as_hash();
SV* get(t_config_option_key opt_key);
SV* get_at(t_config_option_key opt_key, int i);
bool set(t_config_option_key opt_key, SV* value);
bool set_deserialize(t_config_option_key opt_key, SV* str);
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false);
SV* as_hash()
%code{% RETVAL = ConfigBase__as_hash(THIS); %};
SV* get(t_config_option_key opt_key)
%code{% RETVAL = ConfigBase__get(THIS, opt_key); %};
SV* get_at(t_config_option_key opt_key, int i)
%code{% RETVAL = ConfigBase__get_at(THIS, opt_key, i); %};
bool set(t_config_option_key opt_key, SV* value)
%code{% RETVAL = StaticConfig__set(THIS, opt_key, value); %};
bool set_deserialize(t_config_option_key opt_key, SV* str)
%code{% RETVAL = ConfigBase__set_deserialize(THIS, opt_key, str); %};
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false)
%code{% ConfigBase__set_ifndef(THIS, opt_key, value, deserialize); %};
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}
@ -105,12 +129,18 @@
PrintObjectConfig();
~PrintObjectConfig();
bool has(t_config_option_key opt_key);
SV* as_hash();
SV* get(t_config_option_key opt_key);
SV* get_at(t_config_option_key opt_key, int i);
bool set(t_config_option_key opt_key, SV* value);
bool set_deserialize(t_config_option_key opt_key, SV* str);
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false);
SV* as_hash()
%code{% RETVAL = ConfigBase__as_hash(THIS); %};
SV* get(t_config_option_key opt_key)
%code{% RETVAL = ConfigBase__get(THIS, opt_key); %};
SV* get_at(t_config_option_key opt_key, int i)
%code{% RETVAL = ConfigBase__get_at(THIS, opt_key, i); %};
bool set(t_config_option_key opt_key, SV* value)
%code{% RETVAL = StaticConfig__set(THIS, opt_key, value); %};
bool set_deserialize(t_config_option_key opt_key, SV* str)
%code{% RETVAL = ConfigBase__set_deserialize(THIS, opt_key, str); %};
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false)
%code{% ConfigBase__set_ifndef(THIS, opt_key, value, deserialize); %};
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}
@ -127,12 +157,18 @@
FullPrintConfig();
~FullPrintConfig();
bool has(t_config_option_key opt_key);
SV* as_hash();
SV* get(t_config_option_key opt_key);
SV* get_at(t_config_option_key opt_key, int i);
bool set(t_config_option_key opt_key, SV* value);
bool set_deserialize(t_config_option_key opt_key, SV* str);
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false);
SV* as_hash()
%code{% RETVAL = ConfigBase__as_hash(THIS); %};
SV* get(t_config_option_key opt_key)
%code{% RETVAL = ConfigBase__get(THIS, opt_key); %};
SV* get_at(t_config_option_key opt_key, int i)
%code{% RETVAL = ConfigBase__get_at(THIS, opt_key, i); %};
bool set(t_config_option_key opt_key, SV* value)
%code{% RETVAL = StaticConfig__set(THIS, opt_key, value); %};
bool set_deserialize(t_config_option_key opt_key, SV* str)
%code{% RETVAL = ConfigBase__set_deserialize(THIS, opt_key, str); %};
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false)
%code{% ConfigBase__set_ifndef(THIS, opt_key, value, deserialize); %};
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}
@ -244,7 +280,7 @@ print_config_def()
(void)hv_stores( hv, "labels", newRV_noinc((SV*)av) );
}
(void)hv_stores( hv, "default", config.get(opt_key) );
(void)hv_stores( hv, "default", ConfigBase__get(&config, opt_key) );
(void)hv_store( options_hv, opt_key.c_str(), opt_key.length(), newRV_noinc((SV*)hv), 0 );
}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/ExPolygon.hpp"
%}
@ -10,9 +10,9 @@
Clone<ExPolygon> clone()
%code{% RETVAL = THIS; %};
SV* arrayref()
%code{% RETVAL = THIS->to_AV(); %};
%code{% RETVAL = to_AV(THIS); %};
SV* pp()
%code{% RETVAL = THIS->to_SV_pureperl(); %};
%code{% RETVAL = to_SV_pureperl(THIS); %};
Ref<Polygon> contour()
%code{% RETVAL = &(THIS->contour); %};
Polygons* holes()
@ -46,10 +46,10 @@ ExPolygon::new(...)
CODE:
RETVAL = new ExPolygon ();
// ST(0) is class name, ST(1) is contour and others are holes
RETVAL->contour.from_SV_check(ST(1));
from_SV_check(ST(1), &RETVAL->contour);
RETVAL->holes.resize(items-2);
for (unsigned int i = 2; i < items; i++) {
RETVAL->holes[i-2].from_SV_check(ST(i));
from_SV_check(ST(i), &RETVAL->holes[i-2]);
}
OUTPUT:
RETVAL
@ -60,7 +60,7 @@ ExPolygon::rotate(angle, center_sv)
SV* center_sv;
CODE:
Point center;
center.from_SV_check(center_sv);
from_SV_check(center_sv, &center);
THIS->rotate(angle, center);
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/ExPolygonCollection.hpp"
%}
@ -37,7 +37,7 @@ ExPolygonCollection::new(...)
RETVAL->expolygons.resize(items-1);
for (unsigned int i = 1; i < items; i++) {
// Note: a COPY of the input is stored
RETVAL->expolygons[i-1].from_SV_check(ST(i));
from_SV_check(ST(i), &RETVAL->expolygons[i-1]);
}
OUTPUT:
RETVAL
@ -62,7 +62,7 @@ ExPolygonCollection::pp()
av_fill(av, THIS->expolygons.size()-1);
int i = 0;
for (ExPolygons::iterator it = THIS->expolygons.begin(); it != THIS->expolygons.end(); ++it) {
av_store(av, i++, (*it).to_SV_pureperl());
av_store(av, i++, to_SV_pureperl(&*it));
}
RETVAL = newRV_noinc((SV*)av);
OUTPUT:
@ -73,7 +73,7 @@ ExPolygonCollection::append(...)
CODE:
for (unsigned int i = 1; i < items; i++) {
ExPolygon expolygon;
expolygon.from_SV_check( ST(i) );
from_SV_check(ST(i), &expolygon);
THIS->expolygons.push_back(expolygon);
}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/Extruder.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/ExtrusionEntityCollection.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/ExtrusionEntity.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/ExtrusionEntity.hpp"
#include "libslic3r/ExtrusionEntityCollection.hpp"
%}
@ -9,9 +9,9 @@
%name{Slic3r::ExtrusionPath} class ExtrusionPath {
~ExtrusionPath();
SV* arrayref()
%code{% RETVAL = THIS->polyline.to_AV(); %};
%code{% RETVAL = to_AV(&THIS->polyline); %};
SV* pp()
%code{% RETVAL = THIS->polyline.to_SV_pureperl(); %};
%code{% RETVAL = to_SV_pureperl(&THIS->polyline); %};
void pop_back()
%code{% THIS->polyline.points.pop_back(); %};
void reverse();
@ -39,7 +39,7 @@ _new(CLASS, polyline_sv, role, mm3_per_mm, width, height)
float height;
CODE:
RETVAL = new ExtrusionPath (role);
RETVAL->polyline.from_SV_check(polyline_sv);
from_SV_check(polyline_sv, &RETVAL->polyline);
RETVAL->mm3_per_mm = mm3_per_mm;
RETVAL->width = width;
RETVAL->height = height;
@ -50,7 +50,7 @@ Ref<Polyline>
ExtrusionPath::polyline(...)
CODE:
if (items > 1) {
THIS->polyline.from_SV_check( ST(1) );
from_SV_check(ST(1), &THIS->polyline);
}
RETVAL = &(THIS->polyline);
OUTPUT:
@ -101,7 +101,7 @@ ExtrusionPath::append(...)
CODE:
for (unsigned int i = 1; i < items; i++) {
Point p;
p.from_SV_check(ST(i));
from_SV_check(ST(i), &p);
THIS->polyline.points.push_back(p);
}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/Flow.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/GCode.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/GCodeWriter.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "slic3r/GUI/GUI.hpp"
%}

View file

@ -1,6 +1,6 @@
%module{Slic3r::XS};
#include <myinit.h>
#include <xsinit.h>
#include "slic3r/GUI/3DScene.hpp"
%name{Slic3r::GUI::_3DScene::GLVertexArray} class GLVertexArray {

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/Geometry.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/Layer.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/Line.hpp"
#include "libslic3r/Polyline.hpp"
%}
@ -11,9 +11,9 @@
Clone<Line> clone()
%code{% RETVAL = THIS; %};
SV* arrayref()
%code{% RETVAL = THIS->to_AV(); %};
%code{% RETVAL = to_AV(THIS); %};
SV* pp()
%code{% RETVAL = THIS->to_SV_pureperl(); %};
%code{% RETVAL = to_SV_pureperl(THIS); %};
Ref<Point> a()
%code{% RETVAL=&THIS->a; %};
Ref<Point> b()
@ -48,8 +48,8 @@ Line::new(...)
CODE:
RETVAL = new Line ();
// ST(0) is class name, ST(1) and ST(2) are endpoints
RETVAL->a.from_SV_check( ST(1) );
RETVAL->b.from_SV_check( ST(2) );
from_SV_check(ST(1), &RETVAL->a);
from_SV_check(ST(2), &RETVAL->b);
OUTPUT:
RETVAL
@ -59,7 +59,7 @@ Line::rotate(angle, center_sv)
SV* center_sv;
CODE:
Point center;
center.from_SV_check(center_sv);
from_SV_check(center_sv, &center);
THIS->rotate(angle, center);
bool
@ -67,7 +67,7 @@ Line::coincides_with(line_sv)
SV* line_sv;
CODE:
Line line;
line.from_SV_check(line_sv);
from_SV_check(line_sv, &line);
RETVAL = THIS->coincides_with(line);
OUTPUT:
RETVAL

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/Model.hpp"
#include "libslic3r/PrintConfig.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/MotionPlanner.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/PerimeterGenerator.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include <vector>
#include "libslic3r/PlaceholderParser.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Polyline.hpp"
@ -15,9 +15,9 @@
void scale(double factor);
void translate(double x, double y);
SV* arrayref()
%code{% RETVAL = THIS->to_SV_pureperl(); %};
%code{% RETVAL = to_SV_pureperl(THIS); %};
SV* pp()
%code{% RETVAL = THIS->to_SV_pureperl(); %};
%code{% RETVAL = to_SV_pureperl(THIS); %};
long x()
%code{% RETVAL = THIS->x; %};
long y()
@ -58,7 +58,7 @@ Point::rotate(angle, center_sv)
SV* center_sv;
CODE:
Point center;
center.from_SV_check(center_sv);
from_SV_check(center_sv, &center);
THIS->rotate(angle, center);
bool
@ -66,7 +66,7 @@ Point::coincides_with(point_sv)
SV* point_sv;
CODE:
Point point;
point.from_SV_check(point_sv);
from_SV_check(point_sv, &point);
RETVAL = THIS->coincides_with(point);
OUTPUT:
RETVAL
@ -94,9 +94,9 @@ Point::coincides_with(point_sv)
Clone<Pointf> clone()
%code{% RETVAL = THIS; %};
SV* arrayref()
%code{% RETVAL = THIS->to_SV_pureperl(); %};
%code{% RETVAL = to_SV_pureperl(THIS); %};
SV* pp()
%code{% RETVAL = THIS->to_SV_pureperl(); %};
%code{% RETVAL = to_SV_pureperl(THIS); %};
double x()
%code{% RETVAL = THIS->x; %};
double y()

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/BoundingBox.hpp"
@ -12,9 +12,9 @@
Clone<Polygon> clone()
%code{% RETVAL = THIS; %};
SV* arrayref()
%code{% RETVAL = THIS->to_AV(); %};
%code{% RETVAL = to_AV(THIS); %};
SV* pp()
%code{% RETVAL = THIS->to_SV_pureperl(); %};
%code{% RETVAL = to_SV_pureperl(THIS); %};
void scale(double factor);
void translate(double x, double y);
void reverse();
@ -51,7 +51,7 @@ Polygon::new(...)
// ST(0) is class name, ST(1) is first point
RETVAL->points.resize(items-1);
for (unsigned int i = 1; i < items; i++) {
RETVAL->points[i-1].from_SV_check( ST(i) );
from_SV_check(ST(i), &RETVAL->points[i-1]);
}
OUTPUT:
RETVAL
@ -62,7 +62,7 @@ Polygon::rotate(angle, center_sv)
SV* center_sv;
CODE:
Point center;
center.from_SV_check(center_sv);
from_SV_check(center_sv, &center);
THIS->rotate(angle, center);
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/ClipperUtils.hpp"
#include "libslic3r/Polyline.hpp"
@ -12,9 +12,9 @@
Clone<Polyline> clone()
%code{% RETVAL = THIS; %};
SV* arrayref()
%code{% RETVAL = THIS->to_AV(); %};
%code{% RETVAL = to_AV(THIS); %};
SV* pp()
%code{% RETVAL = THIS->to_SV_pureperl(); %};
%code{% RETVAL = to_SV_pureperl(THIS); %};
void scale(double factor);
void translate(double x, double y);
void pop_back()
@ -48,7 +48,7 @@ Polyline::new(...)
// ST(0) is class name, ST(1) is first point
RETVAL->points.resize(items-1);
for (unsigned int i = 1; i < items; i++) {
RETVAL->points[i-1].from_SV_check( ST(i) );
from_SV_check(ST(i), &RETVAL->points[i-1]);
}
OUTPUT:
RETVAL
@ -58,7 +58,7 @@ Polyline::append(...)
CODE:
for (unsigned int i = 1; i < items; i++) {
Point p;
p.from_SV_check( ST(i) );
from_SV_check(ST(i), &p);
THIS->points.push_back(p);
}
@ -76,7 +76,7 @@ Polyline::rotate(angle, center_sv)
SV* center_sv;
CODE:
Point center;
center.from_SV_check(center_sv);
from_SV_check(center_sv, &center);
THIS->rotate(angle, center);
Polygons

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/PolylineCollection.hpp"
%}
@ -34,7 +34,7 @@ PolylineCollection::new(...)
RETVAL->polylines.resize(items-1);
for (unsigned int i = 1; i < items; i++) {
// Note: a COPY of the input is stored
RETVAL->polylines[i-1].from_SV_check(ST(i));
from_SV_check(ST(i), &RETVAL->polylines[i-1]);
}
OUTPUT:
RETVAL
@ -59,7 +59,7 @@ PolylineCollection::pp()
av_fill(av, THIS->polylines.size()-1);
int i = 0;
for (Polylines::iterator it = THIS->polylines.begin(); it != THIS->polylines.end(); ++it) {
av_store(av, i++, (*it).to_SV_pureperl());
av_store(av, i++, to_SV_pureperl(&*it));
}
RETVAL = newRV_noinc((SV*)av);
OUTPUT:
@ -70,7 +70,7 @@ PolylineCollection::append(...)
CODE:
for (unsigned int i = 1; i < items; i++) {
Polyline polyline;
polyline.from_SV_check( ST(i) );
from_SV_check(ST(i), &polyline);
THIS->polylines.push_back(polyline);
}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/Print.hpp"
#include "libslic3r/PlaceholderParser.hpp"
%}

View file

@ -1,6 +1,6 @@
%module{Slic3r::XS};
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/SupportMaterial.hpp"
%package{Slic3r::Print::SupportMaterial};

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/Surface.hpp"
#include "libslic3r/ClipperUtils.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/SurfaceCollection.hpp"
%}

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include <xsinit.h>
#include "libslic3r/TriangleMesh.hpp"
%}
@ -13,7 +13,6 @@
void ReadSTLFile(char* input_file);
void write_ascii(char* output_file);
void write_binary(char* output_file);
void ReadFromPerl(SV* vertices, SV* facets);
void repair();
void WriteOBJFile(char* output_file);
void scale(float factor);
@ -40,6 +39,43 @@
void reset_repair_stats();
%{
void
TriangleMesh::ReadFromPerl(vertices, facets)
SV* vertices
SV* facets
CODE:
stl_file &stl = THIS->stl;
stl.error = 0;
stl.stats.type = inmemory;
// count facets and allocate memory
AV* facets_av = (AV*)SvRV(facets);
stl.stats.number_of_facets = av_len(facets_av)+1;
stl.stats.original_num_facets = stl.stats.number_of_facets;
stl_allocate(&stl);
// read geometry
AV* vertices_av = (AV*)SvRV(vertices);
for (int i = 0; i < stl.stats.number_of_facets; i++) {
AV* facet_av = (AV*)SvRV(*av_fetch(facets_av, i, 0));
stl_facet facet;
facet.normal.x = 0;
facet.normal.y = 0;
facet.normal.z = 0;
for (unsigned int v = 0; v <= 2; v++) {
AV* vertex_av = (AV*)SvRV(*av_fetch(vertices_av, SvIV(*av_fetch(facet_av, v, 0)), 0));
facet.vertex[v].x = SvNV(*av_fetch(vertex_av, 0, 0));
facet.vertex[v].y = SvNV(*av_fetch(vertex_av, 1, 0));
facet.vertex[v].z = SvNV(*av_fetch(vertex_av, 2, 0));
}
facet.extra[0] = 0;
facet.extra[1] = 0;
stl.facet_start[i] = facet;
}
stl_get_size(&stl);
SV*
TriangleMesh::stats()
CODE:

View file

@ -1,7 +1,7 @@
%module{Slic3r::XS};
%package{Slic3r::XS};
#include <myinit.h>
#include <xsinit.h>
%{

View file

@ -355,7 +355,7 @@ T_ARRAYREF
$var.resize(len);
for (unsigned int i = 0; i < len; i++) {
SV** elem = av_fetch(av, i, 0);
$var\[i].from_SV_check(*elem);
from_SV_check(*elem, &$var\[i]);
}
} else
Perl_croak(aTHX_ \"%s: %s is not an array reference\",
@ -514,7 +514,7 @@ T_PTR_ARRAYREF
if (len > 0) av_extend(av, len-1);
int i = 0;
for (${type}::iterator it = $var.begin(); it != $var.end(); ++it) {
av_store(av, i++, (*it)->to_SV());
av_store(av, i++, to_SV(*it));
}
T_LAYER_HEIGHT_RANGES