Further slimming of Perl bindings.

This commit is contained in:
Vojtech Bubnik 2022-05-04 19:10:34 +02:00
parent 576c167bd5
commit aa3231e2c5
24 changed files with 3 additions and 380 deletions

View File

@ -35,7 +35,6 @@ use Slic3r::Config;
use Slic3r::ExPolygon; use Slic3r::ExPolygon;
use Slic3r::ExtrusionLoop; use Slic3r::ExtrusionLoop;
use Slic3r::ExtrusionPath; use Slic3r::ExtrusionPath;
use Slic3r::Flow;
use Slic3r::GCode::Reader; use Slic3r::GCode::Reader;
use Slic3r::Layer; use Slic3r::Layer;
use Slic3r::Line; use Slic3r::Line;

View File

@ -28,8 +28,5 @@ use parent 'Slic3r::Config';
sub Slic3r::Config::GCode::new { Slic3r::Config::Static::new_GCodeConfig } sub Slic3r::Config::GCode::new { Slic3r::Config::Static::new_GCodeConfig }
sub Slic3r::Config::Print::new { Slic3r::Config::Static::new_PrintConfig } sub Slic3r::Config::Print::new { Slic3r::Config::Static::new_PrintConfig }
sub Slic3r::Config::PrintObject::new { Slic3r::Config::Static::new_PrintObjectConfig }
sub Slic3r::Config::PrintRegion::new { Slic3r::Config::Static::new_PrintRegionConfig }
sub Slic3r::Config::Full::new { Slic3r::Config::Static::new_FullPrintConfig }
1; 1;

View File

@ -1,13 +0,0 @@
package Slic3r::Flow;
use strict;
use warnings;
use parent qw(Exporter);
our @EXPORT_OK = qw(FLOW_ROLE_EXTERNAL_PERIMETER FLOW_ROLE_PERIMETER FLOW_ROLE_INFILL
FLOW_ROLE_SOLID_INFILL
FLOW_ROLE_TOP_SOLID_INFILL FLOW_ROLE_SUPPORT_MATERIAL
FLOW_ROLE_SUPPORT_MATERIAL_INTERFACE);
our %EXPORT_TAGS = (roles => \@EXPORT_OK);
1;

View File

@ -12,7 +12,6 @@ our @EXPORT_OK = qw(
scale scale
unscale unscale
scaled_epsilon scaled_epsilon
size_2D
X Y Z X Y Z
convex_hull convex_hull
@ -52,13 +51,4 @@ sub bounding_box {
return @bb[X1,Y1,X2,Y2]; return @bb[X1,Y1,X2,Y2];
} }
# used by ExPolygon::size
sub size_2D {
my @bounding_box = bounding_box(@_);
return (
($bounding_box[X2] - $bounding_box[X1]),
($bounding_box[Y2] - $bounding_box[Y1]),
);
}
1; 1;

View File

@ -4,7 +4,6 @@ use strict;
use warnings; use warnings;
use List::Util qw(min max sum first); use List::Util qw(min max sum first);
use Slic3r::Flow ':roles';
use Slic3r::Surface ':types'; use Slic3r::Surface ':types';
sub layers { sub layers {

View File

@ -197,7 +197,6 @@ double min_object_distance(const ConfigBase &cfg);
// The dynamic configuration is also used to store user modifications of the print global parameters, // The dynamic configuration is also used to store user modifications of the print global parameters,
// so the modified configuration values may be diffed against the active configuration // so the modified configuration values may be diffed against the active configuration
// to invalidate the proper slicing resp. g-code generation processing steps. // to invalidate the proper slicing resp. g-code generation processing steps.
// This object is mapped to Perl as Slic3r::Config.
class DynamicPrintConfig : public DynamicConfig class DynamicPrintConfig : public DynamicConfig
{ {
public: public:
@ -464,7 +463,6 @@ protected: \
BOOST_PP_SEQ_FOR_EACH(PRINT_CONFIG_CLASS_ELEMENT_HASH, _, PARAMETER_DEFINITION_SEQ), \ BOOST_PP_SEQ_FOR_EACH(PRINT_CONFIG_CLASS_ELEMENT_HASH, _, PARAMETER_DEFINITION_SEQ), \
BOOST_PP_SEQ_FOR_EACH(PRINT_CONFIG_CLASS_ELEMENT_EQUAL, _, PARAMETER_DEFINITION_SEQ)) BOOST_PP_SEQ_FOR_EACH(PRINT_CONFIG_CLASS_ELEMENT_EQUAL, _, PARAMETER_DEFINITION_SEQ))
// This object is mapped to Perl as Slic3r::Config::PrintObject.
PRINT_CONFIG_CLASS_DEFINE( PRINT_CONFIG_CLASS_DEFINE(
PrintObjectConfig, PrintObjectConfig,
@ -528,7 +526,6 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionBool, wipe_into_objects)) ((ConfigOptionBool, wipe_into_objects))
) )
// This object is mapped to Perl as Slic3r::Config::PrintRegion.
PRINT_CONFIG_CLASS_DEFINE( PRINT_CONFIG_CLASS_DEFINE(
PrintRegionConfig, PrintRegionConfig,
@ -619,7 +616,6 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloats, machine_min_extruding_rate)) ((ConfigOptionFloats, machine_min_extruding_rate))
) )
// This object is mapped to Perl as Slic3r::Config::GCode.
PRINT_CONFIG_CLASS_DEFINE( PRINT_CONFIG_CLASS_DEFINE(
GCodeConfig, GCodeConfig,
@ -705,7 +701,6 @@ static inline std::string get_extrusion_axis(const GCodeConfig &cfg)
(cfg.gcode_flavor.value == gcfNoExtrusion) ? "" : cfg.extrusion_axis.value; (cfg.gcode_flavor.value == gcfNoExtrusion) ? "" : cfg.extrusion_axis.value;
} }
// This object is mapped to Perl as Slic3r::Config::Print.
PRINT_CONFIG_CLASS_DERIVED_DEFINE( PRINT_CONFIG_CLASS_DERIVED_DEFINE(
PrintConfig, PrintConfig,
(MachineEnvelopeConfig, GCodeConfig), (MachineEnvelopeConfig, GCodeConfig),
@ -784,7 +779,6 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionFloat, z_offset)) ((ConfigOptionFloat, z_offset))
) )
// This object is mapped to Perl as Slic3r::Config::Full.
PRINT_CONFIG_CLASS_DERIVED_DEFINE0( PRINT_CONFIG_CLASS_DERIVED_DEFINE0(
FullPrintConfig, FullPrintConfig,
(PrintObjectConfig, PrintRegionConfig, PrintConfig) (PrintObjectConfig, PrintRegionConfig, PrintConfig)

View File

@ -10,7 +10,6 @@ BEGIN {
use List::Util qw(first); use List::Util qw(first);
use Slic3r; use Slic3r;
use Slic3r::Flow ':roles';
use Slic3r::Geometry qw(PI scale unscale convex_hull); use Slic3r::Geometry qw(PI scale unscale convex_hull);
use Slic3r::Surface ':types'; use Slic3r::Surface ':types';
use Slic3r::Test; use Slic3r::Test;

View File

@ -48,9 +48,7 @@ set(XS_XSP_FILES
${XSP_DIR}/ExPolygon.xsp ${XSP_DIR}/ExPolygon.xsp
${XSP_DIR}/ExtrusionEntityCollection.xsp ${XSP_DIR}/ExtrusionEntityCollection.xsp
${XSP_DIR}/ExtrusionLoop.xsp ${XSP_DIR}/ExtrusionLoop.xsp
${XSP_DIR}/ExtrusionMultiPath.xsp
${XSP_DIR}/ExtrusionPath.xsp ${XSP_DIR}/ExtrusionPath.xsp
${XSP_DIR}/Flow.xsp
${XSP_DIR}/GCode.xsp ${XSP_DIR}/GCode.xsp
${XSP_DIR}/Geometry.xsp ${XSP_DIR}/Geometry.xsp
${XSP_DIR}/Layer.xsp ${XSP_DIR}/Layer.xsp

View File

@ -74,11 +74,6 @@ sub new_from_paths {
return $loop; return $loop;
} }
package Slic3r::ExtrusionMultiPath;
use overload
'@{}' => sub { $_[0]->arrayref },
'fallback' => 1;
package Slic3r::ExtrusionPath; package Slic3r::ExtrusionPath;
use overload use overload
'@{}' => sub { $_[0]->arrayref }, '@{}' => sub { $_[0]->arrayref },
@ -108,25 +103,6 @@ sub clone {
); );
} }
package Slic3r::Flow;
sub new {
my ($class, %args) = @_;
my $self = $class->_new(
@args{qw(width height nozzle_diameter)},
);
return $self;
}
sub new_from_width {
my ($class, %args) = @_;
return $class->_new_from_width(
@args{qw(role width nozzle_diameter layer_height)},
);
}
package Slic3r::Surface; package Slic3r::Surface;
sub new { sub new {
@ -175,26 +151,18 @@ sub new {
package main; package main;
for my $class (qw( for my $class (qw(
Slic3r::Config Slic3r::Config
Slic3r::Config::Full
Slic3r::Config::GCode Slic3r::Config::GCode
Slic3r::Config::Print Slic3r::Config::Print
Slic3r::Config::PrintObject
Slic3r::Config::PrintRegion
Slic3r::Config::Static Slic3r::Config::Static
Slic3r::ExPolygon Slic3r::ExPolygon
Slic3r::ExtrusionLoop Slic3r::ExtrusionLoop
Slic3r::ExtrusionMultiPath
Slic3r::ExtrusionPath Slic3r::ExtrusionPath
Slic3r::ExtrusionPath::Collection Slic3r::ExtrusionPath::Collection
Slic3r::Flow
Slic3r::GCode Slic3r::GCode
Slic3r::Geometry::BoundingBox Slic3r::Geometry::BoundingBox
Slic3r::Geometry::BoundingBoxf
Slic3r::Geometry::BoundingBoxf3
Slic3r::Layer Slic3r::Layer
Slic3r::Layer::Region Slic3r::Layer::Region
Slic3r::Line Slic3r::Line
Slic3r::Linef3
Slic3r::Model Slic3r::Model
Slic3r::Model::Instance Slic3r::Model::Instance
Slic3r::Model::Material Slic3r::Model::Material

View File

@ -4,17 +4,14 @@
namespace Slic3r { namespace Slic3r {
REGISTER_CLASS(ExPolygon, "ExPolygon"); REGISTER_CLASS(ExPolygon, "ExPolygon");
REGISTER_CLASS(ExtrusionMultiPath, "ExtrusionMultiPath");
REGISTER_CLASS(ExtrusionPath, "ExtrusionPath"); REGISTER_CLASS(ExtrusionPath, "ExtrusionPath");
REGISTER_CLASS(ExtrusionLoop, "ExtrusionLoop"); REGISTER_CLASS(ExtrusionLoop, "ExtrusionLoop");
REGISTER_CLASS(ExtrusionEntityCollection, "ExtrusionPath::Collection"); REGISTER_CLASS(ExtrusionEntityCollection, "ExtrusionPath::Collection");
REGISTER_CLASS(Flow, "Flow");
REGISTER_CLASS(CoolingBuffer, "GCode::CoolingBuffer"); REGISTER_CLASS(CoolingBuffer, "GCode::CoolingBuffer");
REGISTER_CLASS(GCode, "GCode"); REGISTER_CLASS(GCode, "GCode");
REGISTER_CLASS(Layer, "Layer"); REGISTER_CLASS(Layer, "Layer");
REGISTER_CLASS(LayerRegion, "Layer::Region"); REGISTER_CLASS(LayerRegion, "Layer::Region");
REGISTER_CLASS(Line, "Line"); REGISTER_CLASS(Line, "Line");
REGISTER_CLASS(Linef3, "Linef3");
REGISTER_CLASS(Polygon, "Polygon"); REGISTER_CLASS(Polygon, "Polygon");
REGISTER_CLASS(Polyline, "Polyline"); REGISTER_CLASS(Polyline, "Polyline");
REGISTER_CLASS(Print, "Print"); REGISTER_CLASS(Print, "Print");
@ -26,20 +23,16 @@ REGISTER_CLASS(ModelObject, "Model::Object");
REGISTER_CLASS(ModelVolume, "Model::Volume"); REGISTER_CLASS(ModelVolume, "Model::Volume");
REGISTER_CLASS(ModelInstance, "Model::Instance"); REGISTER_CLASS(ModelInstance, "Model::Instance");
REGISTER_CLASS(BoundingBox, "Geometry::BoundingBox"); REGISTER_CLASS(BoundingBox, "Geometry::BoundingBox");
REGISTER_CLASS(BoundingBoxf, "Geometry::BoundingBoxf");
REGISTER_CLASS(BoundingBoxf3, "Geometry::BoundingBoxf3");
REGISTER_CLASS(Point, "Point"); REGISTER_CLASS(Point, "Point");
__REGISTER_CLASS(Vec2d, "Pointf"); __REGISTER_CLASS(Vec2d, "Pointf");
__REGISTER_CLASS(Vec3d, "Pointf3"); __REGISTER_CLASS(Vec3d, "Pointf3");
REGISTER_CLASS(DynamicPrintConfig, "Config"); REGISTER_CLASS(DynamicPrintConfig, "Config");
REGISTER_CLASS(StaticPrintConfig, "Config::Static"); REGISTER_CLASS(StaticPrintConfig, "Config::Static");
REGISTER_CLASS(PrintObjectConfig, "Config::PrintObject");
REGISTER_CLASS(PrintRegionConfig, "Config::PrintRegion");
REGISTER_CLASS(GCodeConfig, "Config::GCode"); REGISTER_CLASS(GCodeConfig, "Config::GCode");
REGISTER_CLASS(PrintConfig, "Config::Print"); REGISTER_CLASS(PrintConfig, "Config::Print");
REGISTER_CLASS(FullPrintConfig, "Config::Full");
REGISTER_CLASS(Surface, "Surface"); REGISTER_CLASS(Surface, "Surface");
REGISTER_CLASS(SurfaceCollection, "Surface::Collection"); REGISTER_CLASS(SurfaceCollection, "Surface::Collection");
REGISTER_CLASS(FullPrintConfig, "Config::Full");
REGISTER_CLASS(TriangleMesh, "TriangleMesh"); REGISTER_CLASS(TriangleMesh, "TriangleMesh");
SV* ConfigBase__as_hash(ConfigBase* THIS) SV* ConfigBase__as_hash(ConfigBase* THIS)

View File

@ -50,69 +50,3 @@ new_from_points(CLASS, points)
%} %}
}; };
%name{Slic3r::Geometry::BoundingBoxf} class BoundingBoxf {
BoundingBoxf();
~BoundingBoxf();
Clone<BoundingBoxf> clone()
%code{% RETVAL = THIS; %};
void merge(BoundingBoxf* bb) %code{% THIS->merge(*bb); %};
void merge_point(Vec2d* point) %code{% THIS->merge(*point); %};
void scale(double factor);
void translate(double x, double y);
Clone<Vec2d> size();
Clone<Vec2d> center();
double radius();
bool empty() %code{% RETVAL = empty(*THIS); %};
Clone<Vec2d> min_point() %code{% RETVAL = THIS->min; %};
Clone<Vec2d> max_point() %code{% RETVAL = THIS->max; %};
double x_min() %code{% RETVAL = THIS->min(0); %};
double x_max() %code{% RETVAL = THIS->max(0); %};
double y_min() %code{% RETVAL = THIS->min(1); %};
double y_max() %code{% RETVAL = THIS->max(1); %};
void set_x_min(double val) %code{% THIS->min(0) = val; %};
void set_x_max(double val) %code{% THIS->max(0) = val; %};
void set_y_min(double val) %code{% THIS->min(1) = val; %};
void set_y_max(double val) %code{% THIS->max(1) = val; %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf;%lf,%lf", THIS->min(0), THIS->min(1), THIS->max(0), THIS->max(1)); RETVAL = buf; %};
bool defined() %code{% RETVAL = THIS->defined; %};
%{
BoundingBoxf*
new_from_points(CLASS, points)
char* CLASS
Pointfs points
CODE:
RETVAL = new BoundingBoxf(points);
OUTPUT:
RETVAL
%}
};
%name{Slic3r::Geometry::BoundingBoxf3} class BoundingBoxf3 {
BoundingBoxf3();
~BoundingBoxf3();
Clone<BoundingBoxf3> clone()
%code{% RETVAL = THIS; %};
void merge(BoundingBoxf3* bb) %code{% THIS->merge(*bb); %};
void merge_point(Vec3d* point) %code{% THIS->merge(*point); %};
void scale(double factor);
void translate(double x, double y, double z);
void offset(double delta);
bool contains_point(Vec3d* point) %code{% RETVAL = THIS->contains(*point); %};
Clone<Vec3d> size();
Clone<Vec3d> center();
double radius();
bool empty() %code{% RETVAL = empty(*THIS); %};
Clone<Vec3d> min_point() %code{% RETVAL = THIS->min; %};
Clone<Vec3d> max_point() %code{% RETVAL = THIS->max; %};
double x_min() %code{% RETVAL = THIS->min(0); %};
double x_max() %code{% RETVAL = THIS->max(0); %};
double y_min() %code{% RETVAL = THIS->min(1); %};
double y_max() %code{% RETVAL = THIS->max(1); %};
double z_min() %code{% RETVAL = THIS->min(2); %};
double z_max() %code{% RETVAL = THIS->max(2); %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf,%lf;%lf,%lf,%lf", THIS->min(0), THIS->min(1), THIS->min(2), THIS->max(0), THIS->max(1), THIS->max(2)); RETVAL = buf; %};
bool defined() %code{% RETVAL = THIS->defined; %};
};

View File

@ -76,10 +76,6 @@
%code{% RETVAL = new GCodeConfig(); %}; %code{% RETVAL = new GCodeConfig(); %};
static StaticPrintConfig* new_PrintConfig() static StaticPrintConfig* new_PrintConfig()
%code{% RETVAL = static_cast<GCodeConfig*>(new PrintConfig()); %}; %code{% RETVAL = static_cast<GCodeConfig*>(new PrintConfig()); %};
static StaticPrintConfig* new_PrintObjectConfig()
%code{% RETVAL = new PrintObjectConfig(); %};
static StaticPrintConfig* new_PrintRegionConfig()
%code{% RETVAL = new PrintRegionConfig(); %};
static StaticPrintConfig* new_FullPrintConfig() static StaticPrintConfig* new_FullPrintConfig()
%code{% RETVAL = static_cast<GCodeConfig*>(new FullPrintConfig()); %}; %code{% RETVAL = static_cast<GCodeConfig*>(new FullPrintConfig()); %};
~StaticPrintConfig(); ~StaticPrintConfig();

View File

@ -55,8 +55,6 @@ ExtrusionEntityCollection::arrayref()
// return our item by reference // return our item by reference
if (ExtrusionPath* path = dynamic_cast<ExtrusionPath*>(*it)) { if (ExtrusionPath* path = dynamic_cast<ExtrusionPath*>(*it)) {
sv_setref_pv( sv, perl_class_name_ref(path), path ); sv_setref_pv( sv, perl_class_name_ref(path), path );
} else if (ExtrusionMultiPath* multipath = dynamic_cast<ExtrusionMultiPath*>(*it)) {
sv_setref_pv( sv, perl_class_name_ref(multipath), multipath );
} else if (ExtrusionLoop* loop = dynamic_cast<ExtrusionLoop*>(*it)) { } else if (ExtrusionLoop* loop = dynamic_cast<ExtrusionLoop*>(*it)) {
sv_setref_pv( sv, perl_class_name_ref(loop), loop ); sv_setref_pv( sv, perl_class_name_ref(loop), loop );
} else if (ExtrusionEntityCollection* collection = dynamic_cast<ExtrusionEntityCollection*>(*it)) { } else if (ExtrusionEntityCollection* collection = dynamic_cast<ExtrusionEntityCollection*>(*it)) {
@ -81,8 +79,6 @@ ExtrusionEntityCollection::append(...)
// append COPIES // append COPIES
if (ExtrusionPath* path = dynamic_cast<ExtrusionPath*>(entity)) { if (ExtrusionPath* path = dynamic_cast<ExtrusionPath*>(entity)) {
THIS->entities.push_back( new ExtrusionPath(*path) ); THIS->entities.push_back( new ExtrusionPath(*path) );
} else if (ExtrusionMultiPath* multipath = dynamic_cast<ExtrusionMultiPath*>(entity)) {
THIS->entities.push_back( new ExtrusionMultiPath(*multipath) );
} else if (ExtrusionLoop* loop = dynamic_cast<ExtrusionLoop*>(entity)) { } else if (ExtrusionLoop* loop = dynamic_cast<ExtrusionLoop*>(entity)) {
THIS->entities.push_back( new ExtrusionLoop(*loop) ); THIS->entities.push_back( new ExtrusionLoop(*loop) );
} else if(ExtrusionEntityCollection* collection = dynamic_cast<ExtrusionEntityCollection*>(entity)) { } else if(ExtrusionEntityCollection* collection = dynamic_cast<ExtrusionEntityCollection*>(entity)) {

View File

@ -1,38 +0,0 @@
%module{Slic3r::XS};
%{
#include <xsinit.h>
#include "libslic3r/ExtrusionEntity.hpp"
%}
%name{Slic3r::ExtrusionMultiPath} class ExtrusionMultiPath {
ExtrusionMultiPath();
~ExtrusionMultiPath();
Clone<ExtrusionMultiPath> clone()
%code{% RETVAL = THIS; %};
void reverse();
Clone<Point> first_point();
Clone<Point> last_point();
void append(ExtrusionPath* path)
%code{% THIS->paths.push_back(*path); %};
double length();
Polygons polygons_covered_by_width();
Polygons polygons_covered_by_spacing();
Clone<Polyline> polyline()
%code{% RETVAL = THIS->as_polyline(); %};
%{
SV*
ExtrusionMultiPath::arrayref()
CODE:
AV* av = newAV();
av_fill(av, THIS->paths.size()-1);
for (ExtrusionPaths::iterator it = THIS->paths.begin(); it != THIS->paths.end(); ++it) {
av_store(av, it - THIS->paths.begin(), perl_to_SV_ref(*it));
}
RETVAL = newRV_noinc((SV*)av);
OUTPUT:
RETVAL
%}
};

View File

@ -1,60 +0,0 @@
%module{Slic3r::XS};
%{
#include <xsinit.h>
#include "libslic3r/Flow.hpp"
%}
%name{Slic3r::Flow} class Flow {
~Flow();
%name{_new} Flow(float width, float height, float nozzle_diameter);
Clone<Flow> clone()
%code{% RETVAL = THIS; %};
float width();
float height();
float nozzle_diameter();
bool bridge();
float spacing();
int scaled_width();
int scaled_spacing();
double mm3_per_mm();
%{
Flow*
_new_from_width(CLASS, role, width, nozzle_diameter, height)
char* CLASS;
FlowRole role;
std::string width;
float nozzle_diameter;
float height;
CODE:
ConfigOptionFloatOrPercent optwidth;
optwidth.deserialize(width, ForwardCompatibilitySubstitutionRule::Disable);
RETVAL = new Flow(Flow::new_from_config_width(role, optwidth, nozzle_diameter, height));
OUTPUT:
RETVAL
%}
};
%package{Slic3r::Flow};
%{
IV
_constant()
ALIAS:
FLOW_ROLE_EXTERNAL_PERIMETER = frExternalPerimeter
FLOW_ROLE_PERIMETER = frPerimeter
FLOW_ROLE_INFILL = frInfill
FLOW_ROLE_SOLID_INFILL = frSolidInfill
FLOW_ROLE_TOP_SOLID_INFILL = frTopSolidInfill
FLOW_ROLE_SUPPORT_MATERIAL = frSupportMaterial
FLOW_ROLE_SUPPORT_MATERIAL_INTERFACE = frSupportMaterialInterface
PROTOTYPE:
CODE:
RETVAL = ix;
OUTPUT: RETVAL
%}

View File

@ -10,35 +10,8 @@
%package{Slic3r::Geometry}; %package{Slic3r::Geometry};
Pointfs arrange(size_t total_parts, Vec2d* part, coordf_t dist, BoundingBoxf* bb = NULL)
%code{%
Pointfs points;
if (! Slic3r::Geometry::arrange(total_parts, *part, dist, bb, points))
CONFESS("%zu parts won't fit in your print area!\n", total_parts);
RETVAL = points;
%};
%{ %{
bool
directions_parallel(angle1, angle2)
double angle1
double angle2
CODE:
RETVAL = Slic3r::Geometry::directions_parallel(angle1, angle2);
OUTPUT:
RETVAL
bool
directions_parallel_within(angle1, angle2, max_diff)
double angle1
double angle2
double max_diff
CODE:
RETVAL = Slic3r::Geometry::directions_parallel(angle1, angle2, max_diff);
OUTPUT:
RETVAL
Clone<Polygon> Clone<Polygon>
convex_hull(points) convex_hull(points)
Points points Points points
@ -72,16 +45,6 @@ deg2rad(angle)
OUTPUT: OUTPUT:
RETVAL RETVAL
Polygons
simplify_polygons(polygons, tolerance)
Polygons polygons
double tolerance
CODE:
Slic3r::Geometry::simplify_polygons(polygons, tolerance, &RETVAL);
OUTPUT:
RETVAL
IV IV
_constant() _constant()
ALIAS: ALIAS:

View File

@ -23,8 +23,6 @@
Ref<ExtrusionEntityCollection> fills() Ref<ExtrusionEntityCollection> fills()
%code%{ RETVAL = &THIS->fills; %}; %code%{ RETVAL = &THIS->fills; %};
Clone<Flow> flow(FlowRole role)
%code%{ RETVAL = THIS->flow(role); %};
void prepare_fill_surfaces(); void prepare_fill_surfaces();
void make_perimeters(SurfaceCollection* slices, SurfaceCollection* fill_surfaces) void make_perimeters(SurfaceCollection* slices, SurfaceCollection* fill_surfaces)
%code%{ THIS->make_perimeters(*slices, fill_surfaces); %}; %code%{ THIS->make_perimeters(*slices, fill_surfaces); %};

View File

@ -76,17 +76,3 @@ Line::coincides_with(line_sv)
%} %}
}; };
%name{Slic3r::Linef3} class Linef3 {
Linef3(Vec3d* a, Vec3d* b)
%code{% RETVAL = new Linef3(*a, *b); %};
~Linef3();
Clone<Linef3> clone()
%code{% RETVAL = THIS; %};
Ref<Vec3d> a()
%code{% RETVAL = &THIS->a; %};
Ref<Vec3d> b()
%code{% RETVAL = &THIS->b; %};
Clone<Vec3d> intersect_plane(double z);
void scale(double factor);
};

View File

@ -71,7 +71,6 @@
%code%{ RETVAL = THIS->materials.size(); %}; %code%{ RETVAL = THIS->materials.size(); %};
bool add_default_instances(); bool add_default_instances();
Clone<BoundingBoxf3> bounding_box();
void center_instances_around_point(Vec2d* point) void center_instances_around_point(Vec2d* point)
%code%{ THIS->center_instances_around_point(*point); %}; %code%{ THIS->center_instances_around_point(*point); %};
void translate(double x, double y, double z); void translate(double x, double y, double z);
@ -80,11 +79,8 @@
ModelObjectPtrs* objects() ModelObjectPtrs* objects()
%code%{ RETVAL = &THIS->objects; %}; %code%{ RETVAL = &THIS->objects; %};
bool arrange_objects(double dist, BoundingBoxf* bb = NULL) %code%{ ArrangeParams ap{scaled(dist)}; if (bb) arrange_objects(*THIS, scaled(*bb), ap); else arrange_objects(*THIS, InfiniteBed{}, ap); %}; bool arrange_objects(double dist) %code%{ ArrangeParams ap{scaled(dist)}; arrange_objects(*THIS, InfiniteBed{}, ap); %};
void duplicate(unsigned int copies_num, double dist, BoundingBoxf* bb = NULL) %code%{ ArrangeParams ap{scaled(dist)}; if (bb) duplicate(*THIS, copies_num, scaled(*bb), ap); else duplicate(*THIS, copies_num, InfiniteBed{}, ap); %}; void duplicate(unsigned int copies_num, double dist) %code%{ ArrangeParams ap{scaled(dist)}; duplicate(*THIS, copies_num, InfiniteBed{}, ap); %};
void duplicate_objects(unsigned int copies_num, double dist, BoundingBoxf* bb = NULL) %code%{ ArrangeParams ap{scaled(dist)}; if (bb) duplicate_objects(*THIS, copies_num, scaled(*bb), ap); else duplicate_objects(*THIS, copies_num, InfiniteBed{}, ap); %};
void duplicate_objects_grid(unsigned int x, unsigned int y, double dist);
bool looks_like_multipart_object() const; bool looks_like_multipart_object() const;
void convert_multipart_object(unsigned int max_extruders); void convert_multipart_object(unsigned int max_extruders);
@ -150,9 +146,6 @@ ModelMaterial::attributes()
void invalidate_bounding_box(); void invalidate_bounding_box();
Clone<TriangleMesh> mesh(); Clone<TriangleMesh> mesh();
Clone<TriangleMesh> raw_mesh(); Clone<TriangleMesh> raw_mesh();
Clone<BoundingBoxf3> instance_bounding_box(int idx)
%code%{ RETVAL = THIS->instance_bounding_box(idx, true); %};
Clone<BoundingBoxf3> bounding_box();
%name{_add_volume} Ref<ModelVolume> add_volume(TriangleMesh* mesh) %name{_add_volume} Ref<ModelVolume> add_volume(TriangleMesh* mesh)
%code%{ RETVAL = THIS->add_volume(*mesh); %}; %code%{ RETVAL = THIS->add_volume(*mesh); %};
@ -290,7 +283,4 @@ ModelMaterial::attributes()
THIS->set_offset(X, (*offset)(0)); THIS->set_offset(X, (*offset)(0));
THIS->set_offset(Y, (*offset)(1)); THIS->set_offset(Y, (*offset)(1));
%}; %};
void transform_mesh(TriangleMesh* mesh, bool dont_translate = false) const;
void transform_polygon(Polygon* polygon) const;
}; };

View File

@ -34,12 +34,8 @@
bool contains_point(Point* point) bool contains_point(Point* point)
%code{% RETVAL = THIS->contains(*point); %}; %code{% RETVAL = THIS->contains(*point); %};
Polygons simplify(double tolerance); Polygons simplify(double tolerance);
Polygons triangulate_convex()
%code{% THIS->triangulate_convex(&RETVAL); %};
Clone<Point> centroid(); Clone<Point> centroid();
Clone<BoundingBox> bounding_box(); Clone<BoundingBox> bounding_box();
Clone<Point> point_projection(Point* point)
%code{% RETVAL = THIS->point_projection(*point); %};
Clone<Point> first_intersection(Line* line) Clone<Point> first_intersection(Line* line)
%code{% %code{%
Point p; Point p;

View File

@ -42,20 +42,6 @@ SurfaceCollection::filter_by_type(surface_type)
OUTPUT: OUTPUT:
RETVAL RETVAL
void
SurfaceCollection::replace(index, surface)
int index
Surface* surface
CODE:
THIS->surfaces[index] = *surface;
void
SurfaceCollection::set_surface_type(index, surface_type)
int index
SurfaceType surface_type;
CODE:
THIS->surfaces[index].surface_type = surface_type;
SV* SV*
SurfaceCollection::group() SurfaceCollection::group()
CODE: CODE:

View File

@ -28,7 +28,6 @@
void merge(TriangleMesh* mesh) void merge(TriangleMesh* mesh)
%code{% THIS->merge(*mesh); %}; %code{% THIS->merge(*mesh); %};
Clone<Polygon> convex_hull(); Clone<Polygon> convex_hull();
Clone<BoundingBoxf3> bounding_box();
Clone<Vec3d> center() Clone<Vec3d> center()
%code{% RETVAL = THIS->bounding_box().center(); %}; %code{% RETVAL = THIS->bounding_box().center(); %};
int facets_count(); int facets_count();

View File

@ -18,14 +18,6 @@ BoundingBox* O_OBJECT_SLIC3R
Ref<BoundingBox> O_OBJECT_SLIC3R_T Ref<BoundingBox> O_OBJECT_SLIC3R_T
Clone<BoundingBox> O_OBJECT_SLIC3R_T Clone<BoundingBox> O_OBJECT_SLIC3R_T
BoundingBoxf* O_OBJECT_SLIC3R
Ref<BoundingBoxf> O_OBJECT_SLIC3R_T
Clone<BoundingBoxf> O_OBJECT_SLIC3R_T
BoundingBoxf3* O_OBJECT_SLIC3R
Ref<BoundingBoxf3> O_OBJECT_SLIC3R_T
Clone<BoundingBoxf3> O_OBJECT_SLIC3R_T
DynamicPrintConfig* O_OBJECT_SLIC3R DynamicPrintConfig* O_OBJECT_SLIC3R
Ref<DynamicPrintConfig> O_OBJECT_SLIC3R_T Ref<DynamicPrintConfig> O_OBJECT_SLIC3R_T
Clone<DynamicPrintConfig> O_OBJECT_SLIC3R_T Clone<DynamicPrintConfig> O_OBJECT_SLIC3R_T
@ -33,12 +25,6 @@ Clone<DynamicPrintConfig> O_OBJECT_SLIC3R_T
StaticPrintConfig* O_OBJECT_SLIC3R StaticPrintConfig* O_OBJECT_SLIC3R
Ref<StaticPrintConfig> O_OBJECT_SLIC3R_T Ref<StaticPrintConfig> O_OBJECT_SLIC3R_T
PrintObjectConfig* O_OBJECT_SLIC3R
Ref<PrintObjectConfig> O_OBJECT_SLIC3R_T
PrintRegionConfig* O_OBJECT_SLIC3R
Ref<PrintRegionConfig> O_OBJECT_SLIC3R_T
GCodeConfig* O_OBJECT_SLIC3R GCodeConfig* O_OBJECT_SLIC3R
Ref<GCodeConfig> O_OBJECT_SLIC3R_T Ref<GCodeConfig> O_OBJECT_SLIC3R_T
@ -72,10 +58,6 @@ Line* O_OBJECT_SLIC3R
Ref<Line> O_OBJECT_SLIC3R_T Ref<Line> O_OBJECT_SLIC3R_T
Clone<Line> O_OBJECT_SLIC3R_T Clone<Line> O_OBJECT_SLIC3R_T
Linef3* O_OBJECT_SLIC3R
Ref<Linef3> O_OBJECT_SLIC3R_T
Clone<Linef3> O_OBJECT_SLIC3R_T
Polyline* O_OBJECT_SLIC3R Polyline* O_OBJECT_SLIC3R
Ref<Polyline> O_OBJECT_SLIC3R_T Ref<Polyline> O_OBJECT_SLIC3R_T
Clone<Polyline> O_OBJECT_SLIC3R_T Clone<Polyline> O_OBJECT_SLIC3R_T
@ -92,10 +74,6 @@ ExtrusionEntityCollection* O_OBJECT_SLIC3R
Ref<ExtrusionEntityCollection> O_OBJECT_SLIC3R_T Ref<ExtrusionEntityCollection> O_OBJECT_SLIC3R_T
Clone<ExtrusionEntityCollection> O_OBJECT_SLIC3R_T Clone<ExtrusionEntityCollection> O_OBJECT_SLIC3R_T
ExtrusionMultiPath* O_OBJECT_SLIC3R
Ref<ExtrusionMultiPath> O_OBJECT_SLIC3R_T
Clone<ExtrusionMultiPath> O_OBJECT_SLIC3R_T
ExtrusionPath* O_OBJECT_SLIC3R ExtrusionPath* O_OBJECT_SLIC3R
Ref<ExtrusionPath> O_OBJECT_SLIC3R_T Ref<ExtrusionPath> O_OBJECT_SLIC3R_T
Clone<ExtrusionPath> O_OBJECT_SLIC3R_T Clone<ExtrusionPath> O_OBJECT_SLIC3R_T
@ -104,10 +82,6 @@ ExtrusionLoop* O_OBJECT_SLIC3R
Ref<ExtrusionLoop> O_OBJECT_SLIC3R_T Ref<ExtrusionLoop> O_OBJECT_SLIC3R_T
Clone<ExtrusionLoop> O_OBJECT_SLIC3R_T Clone<ExtrusionLoop> O_OBJECT_SLIC3R_T
Flow* O_OBJECT_SLIC3R
Ref<Flow> O_OBJECT_SLIC3R_T
Clone<Flow> O_OBJECT_SLIC3R_T
Surface* O_OBJECT_SLIC3R Surface* O_OBJECT_SLIC3R
Ref<Surface> O_OBJECT_SLIC3R_T Ref<Surface> O_OBJECT_SLIC3R_T
Clone<Surface> O_OBJECT_SLIC3R_T Clone<Surface> O_OBJECT_SLIC3R_T
@ -164,8 +138,6 @@ ExtrusionLoopRole T_UV
ExtrusionRole T_UV ExtrusionRole T_UV
FlowRole T_UV FlowRole T_UV
SurfaceType T_UV SurfaceType T_UV
Slic3r::ClipperLib::JoinType T_UV
Slic3r::ClipperLib::PolyFillType T_UV
# we return these types whenever we want the items to be cloned # we return these types whenever we want the items to be cloned
Points T_ARRAYREF Points T_ARRAYREF

View File

@ -30,21 +30,11 @@
%typemap{BoundingBox*}; %typemap{BoundingBox*};
%typemap{Ref<BoundingBox>}{simple}; %typemap{Ref<BoundingBox>}{simple};
%typemap{Clone<BoundingBox>}{simple}; %typemap{Clone<BoundingBox>}{simple};
%typemap{BoundingBoxf*};
%typemap{Ref<BoundingBoxf>}{simple};
%typemap{Clone<BoundingBoxf>}{simple};
%typemap{BoundingBoxf3*};
%typemap{Ref<BoundingBoxf3>}{simple};
%typemap{Clone<BoundingBoxf3>}{simple};
%typemap{DynamicPrintConfig*}; %typemap{DynamicPrintConfig*};
%typemap{Ref<DynamicPrintConfig>}{simple}; %typemap{Ref<DynamicPrintConfig>}{simple};
%typemap{Clone<DynamicPrintConfig>}{simple}; %typemap{Clone<DynamicPrintConfig>}{simple};
%typemap{StaticPrintConfig*}; %typemap{StaticPrintConfig*};
%typemap{Ref<StaticPrintConfig>}{simple}; %typemap{Ref<StaticPrintConfig>}{simple};
%typemap{PrintObjectConfig*};
%typemap{Ref<PrintObjectConfig>}{simple};
%typemap{PrintRegionConfig*};
%typemap{Ref<PrintRegionConfig>}{simple};
%typemap{GCodeConfig*}; %typemap{GCodeConfig*};
%typemap{Ref<GCodeConfig>}{simple}; %typemap{Ref<GCodeConfig>}{simple};
%typemap{PrintConfig*}; %typemap{PrintConfig*};
@ -54,15 +44,9 @@
%typemap{ExPolygon*}; %typemap{ExPolygon*};
%typemap{Ref<ExPolygon>}{simple}; %typemap{Ref<ExPolygon>}{simple};
%typemap{Clone<ExPolygon>}{simple}; %typemap{Clone<ExPolygon>}{simple};
%typemap{Flow*};
%typemap{Ref<Flow>}{simple};
%typemap{Clone<Flow>}{simple};
%typemap{Line*}; %typemap{Line*};
%typemap{Ref<Line>}{simple}; %typemap{Ref<Line>}{simple};
%typemap{Clone<Line>}{simple}; %typemap{Clone<Line>}{simple};
%typemap{Linef3*};
%typemap{Ref<Linef3>}{simple};
%typemap{Clone<Linef3>}{simple};
%typemap{Polyline*}; %typemap{Polyline*};
%typemap{Ref<Polyline>}{simple}; %typemap{Ref<Polyline>}{simple};
%typemap{Clone<Polyline>}{simple}; %typemap{Clone<Polyline>}{simple};
@ -72,9 +56,6 @@
%typemap{ExtrusionEntityCollection*}; %typemap{ExtrusionEntityCollection*};
%typemap{Ref<ExtrusionEntityCollection>}{simple}; %typemap{Ref<ExtrusionEntityCollection>}{simple};
%typemap{Clone<ExtrusionEntityCollection>}{simple}; %typemap{Clone<ExtrusionEntityCollection>}{simple};
%typemap{ExtrusionMultiPath*};
%typemap{Ref<ExtrusionMultiPath>}{simple};
%typemap{Clone<ExtrusionMultiPath>}{simple};
%typemap{ExtrusionPath*}; %typemap{ExtrusionPath*};
%typemap{Ref<ExtrusionPath>}{simple}; %typemap{Ref<ExtrusionPath>}{simple};
%typemap{Clone<ExtrusionPath>}{simple}; %typemap{Clone<ExtrusionPath>}{simple};