Merge branch 'master' into visilibity

Conflicts:
	lib/Slic3r/GCode.pm
	xs/MANIFEST
This commit is contained in:
Alessandro Ranellucci 2014-05-27 00:04:53 +02:00
commit 7215e66a6a
68 changed files with 1258 additions and 825 deletions

View file

@ -45,7 +45,6 @@
%code{% THIS->apply(*other, true); %};
std::vector<std::string> get_keys()
%code{% THIS->keys(&RETVAL); %};
std::string get_extrusion_axis();
};
%name{Slic3r::Config::PrintRegion} class PrintRegionConfig {
@ -103,10 +102,17 @@
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}
double get_abs_value(t_config_option_key opt_key, double ratio_over);
void apply_print_config(PrintConfig* other)
%code{% THIS->apply(*other, true); %};
void apply_object_config(PrintObjectConfig* other)
%code{% THIS->apply(*other, true); %};
void apply_region_config(PrintRegionConfig* other)
%code{% THIS->apply(*other, true); %};
void apply_dynamic(DynamicPrintConfig* other)
%code{% THIS->apply(*other, true); %};
std::vector<std::string> get_keys()
%code{% THIS->keys(&RETVAL); %};
std::string get_extrusion_axis();
};
%package{Slic3r::Config};

View file

@ -20,6 +20,8 @@
void append(ExtrusionPath* path)
%code{% THIS->paths.push_back(*path); %};
double length();
void split_at_vertex(Point* point)
%code{% THIS->split_at_vertex(*point); %};
void split_at(Point* point)
%code{% THIS->split_at(*point); %};
ExtrusionPaths clip_end(double distance)
@ -41,5 +43,31 @@ ExtrusionLoop::arrayref()
OUTPUT:
RETVAL
ExtrusionLoopRole
ExtrusionLoop::role(...)
CODE:
if (items > 1) {
THIS->role = (ExtrusionLoopRole)SvUV(ST(1));
}
RETVAL = THIS->role;
OUTPUT:
RETVAL
%}
};
%package{Slic3r::ExtrusionLoop};
%{
IV
_constant()
ALIAS:
EXTRL_ROLE_DEFAULT = elrDefault
EXTRL_ROLE_EXTERNAL_PERIMETER = elrExternalPerimeter
EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER = elrContourInternalPerimeter
PROTOTYPE:
CODE:
RETVAL = ix;
OUTPUT: RETVAL
%}

View file

@ -39,9 +39,8 @@ _new(CLASS, polyline_sv, role, mm3_per_mm, width, height)
float width;
float height;
CODE:
RETVAL = new ExtrusionPath ();
RETVAL = new ExtrusionPath (role);
RETVAL->polyline.from_SV_check(polyline_sv);
RETVAL->role = role;
RETVAL->mm3_per_mm = mm3_per_mm;
RETVAL->width = width;
RETVAL->height = height;
@ -135,15 +134,14 @@ _constant()
EXTR_ROLE_PERIMETER = erPerimeter
EXTR_ROLE_EXTERNAL_PERIMETER = erExternalPerimeter
EXTR_ROLE_OVERHANG_PERIMETER = erOverhangPerimeter
EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER = erContourInternalPerimeter
EXTR_ROLE_FILL = erFill
EXTR_ROLE_SOLIDFILL = erSolidFill
EXTR_ROLE_TOPSOLIDFILL = erTopSolidFill
EXTR_ROLE_BRIDGE = erBridge
EXTR_ROLE_INTERNALBRIDGE = erInternalBridge
EXTR_ROLE_FILL = erInternalInfill
EXTR_ROLE_SOLIDFILL = erSolidInfill
EXTR_ROLE_TOPSOLIDFILL = erTopSolidInfill
EXTR_ROLE_BRIDGE = erBridgeInfill
EXTR_ROLE_GAPFILL = erGapFill
EXTR_ROLE_SKIRT = erSkirt
EXTR_ROLE_SUPPORTMATERIAL = erSupportMaterial
EXTR_ROLE_GAPFILL = erGapFill
EXTR_ROLE_SUPPORTMATERIAL_INTERFACE = erSupportMaterialInterface
PROTOTYPE:
CODE:
RETVAL = ix;

View file

@ -151,8 +151,8 @@ ModelMaterial::attributes()
void set_layer_height_ranges(t_layer_height_ranges ranges)
%code%{ THIS->layer_height_ranges = ranges; %};
Clone<Pointf> origin_translation()
%code%{ RETVAL = THIS->origin_translation; %};
Ref<Pointf> origin_translation()
%code%{ RETVAL = &THIS->origin_translation; %};
void set_origin_translation(Pointf* point)
%code%{ THIS->origin_translation = *point; %};
};
@ -185,8 +185,8 @@ ModelMaterial::attributes()
%code%{ RETVAL = THIS->rotation; %};
double scaling_factor()
%code%{ RETVAL = THIS->scaling_factor; %};
Clone<Pointf> offset()
%code%{ RETVAL = THIS->offset; %};
Ref<Pointf> offset()
%code%{ RETVAL = &THIS->offset; %};
void set_rotation(double val)
%code%{ THIS->rotation = val; %};

View file

@ -29,6 +29,14 @@
%code{% RETVAL = THIS->distance_to(*line); %};
double ccw(Point* p1, Point* p2)
%code{% RETVAL = THIS->ccw(*p1, *p2); %};
Clone<Point> projection_onto_polygon(Polygon* polygon)
%code{% RETVAL = new Point(THIS->projection_onto(*polygon)); %};
Clone<Point> projection_onto_polyline(Polyline* polyline)
%code{% RETVAL = new Point(THIS->projection_onto(*polyline)); %};
Clone<Point> projection_onto_line(Line* line)
%code{% RETVAL = new Point(THIS->projection_onto(*line)); %};
Clone<Point> negative()
%code{% RETVAL = new Point(THIS->negative()); %};
%{

View file

@ -2,6 +2,7 @@
%{
#include <myinit.h>
#include "BoundingBox.hpp"
#include "Polygon.hpp"
%}
@ -17,8 +18,8 @@
void translate(double x, double y);
void reverse();
Lines lines();
Polyline* split_at(Point* point)
%code{% RETVAL = new Polyline(); THIS->split_at(*point, RETVAL); %};
Polyline* split_at_vertex(Point* point)
%code{% RETVAL = new Polyline(); THIS->split_at_vertex(*point, RETVAL); %};
Polyline* split_at_index(int index)
%code{% RETVAL = new Polyline(); THIS->split_at_index(index, RETVAL); %};
Polyline* split_at_first_point()
@ -38,6 +39,12 @@
Polygons simplify(double tolerance);
Polygons triangulate_convex()
%code{% THIS->triangulate_convex(&RETVAL); %};
Clone<Point> centroid();
BoundingBox* bounding_box()
%code{%
RETVAL = new BoundingBox();
THIS->bounding_box(RETVAL);
%};
%{
Polygon*

View file

@ -2,6 +2,7 @@
%{
#include <myinit.h>
#include "BoundingBox.hpp"
#include "ClipperUtils.hpp"
#include "Polyline.hpp"
%}
@ -31,6 +32,8 @@
void extend_end(double distance);
void extend_start(double distance);
void simplify(double tolerance);
void split_at(Point* point, Polyline* p1, Polyline* p2)
%code{% THIS->split_at(*point, p1, p2); %};
%{
Polyline*

View file

@ -114,6 +114,7 @@ MotionPlanner* O_OBJECT_SLIC3R
Ref<MotionPlanner> O_OBJECT_SLIC3R_T
Clone<MotionPlanner> O_OBJECT_SLIC3R_T
ExtrusionLoopRole T_UV
ExtrusionRole T_UV
FlowRole T_UV
PrintStep T_UV

View file

@ -115,6 +115,12 @@
$CVar = (SurfaceType)SvUV($PerlVar);
%};
};
%typemap{ExtrusionLoopRole}{parsed}{
%cpp_type{ExtrusionLoopRole};
%precall_code{%
$CVar = (ExtrusionLoopRole)SvUV($PerlVar);
%};
};
%typemap{ExtrusionRole}{parsed}{
%cpp_type{ExtrusionRole};
%precall_code{%