Merge branch 'master' into sender

This commit is contained in:
Alessandro Ranellucci 2014-12-26 01:30:48 +01:00
commit 005f138ce7
102 changed files with 3245 additions and 1672 deletions

View file

@ -83,6 +83,7 @@ new_from_points(CLASS, points)
Clone<BoundingBoxf3> clone()
%code{% RETVAL = THIS; %};
void merge(BoundingBoxf3* bb) %code{% THIS->merge(*bb); %};
void merge_point(Pointf3* point) %code{% THIS->merge(*point); %};
void scale(double factor);
void translate(double x, double y, double z);
Clone<Pointf3> size();

View file

@ -23,6 +23,8 @@
%code{% THIS->apply(*other, true); %};
std::vector<std::string> diff(DynamicPrintConfig* other)
%code{% RETVAL = THIS->diff(*other); %};
bool equals(DynamicPrintConfig* other)
%code{% RETVAL = THIS->equals(*other); %};
void apply_static(FullPrintConfig* other)
%code{% THIS->apply(*other, true); %};
std::vector<std::string> get_keys()

View file

@ -28,6 +28,9 @@
%code{% THIS->clip_end(distance, &RETVAL); %};
bool has_overhang_point(Point* point)
%code{% RETVAL = THIS->has_overhang_point(*point); %};
bool is_perimeter();
bool is_infill();
bool is_solid_infill();
%{
SV*

View file

@ -23,7 +23,8 @@
void simplify(double tolerance);
double length();
bool is_perimeter();
bool is_fill();
bool is_infill();
bool is_solid_infill();
bool is_bridge();
std::string gcode(Extruder* extruder, double e, double F,
double xofs, double yofs, std::string extrusion_axis,

View file

@ -44,6 +44,7 @@
std::string unretract();
std::string lift();
std::string unlift();
Clone<Pointf3> get_position() const;
%{
SV*

View file

@ -69,6 +69,12 @@
%code%{ RETVAL = (int)(intptr_t)THIS; %};
void make_slices();
bool any_internal_region_slice_contains_line(Line* line)
%code%{ RETVAL = THIS->any_internal_region_slice_contains(*line); %};
bool any_internal_region_fill_surface_contains_line(Line* line)
%code%{ RETVAL = THIS->any_internal_region_fill_surface_contains(*line); %};
bool any_internal_region_fill_surface_contains_polyline(Polyline* polyline)
%code%{ RETVAL = THIS->any_internal_region_fill_surface_contains(*polyline); %};
};
%name{Slic3r::Layer::Support} class SupportLayer {
@ -114,4 +120,11 @@
Ref<ExPolygonCollection> slices()
%code%{ RETVAL = &THIS->slices; %};
bool any_internal_region_slice_contains_line(Line* line)
%code%{ RETVAL = THIS->any_internal_region_slice_contains(*line); %};
bool any_internal_region_fill_surface_contains_line(Line* line)
%code%{ RETVAL = THIS->any_internal_region_fill_surface_contains(*line); %};
bool any_internal_region_fill_surface_contains_polyline(Polyline* polyline)
%code%{ RETVAL = THIS->any_internal_region_fill_surface_contains(*polyline); %};
};

View file

@ -32,6 +32,7 @@
Clone<Point> point_at(double distance);
Polyline* as_polyline()
%code{% RETVAL = new Polyline(*THIS); %};
Clone<Point> normal();
%{
Line*
@ -65,3 +66,17 @@ Line::coincides_with(line_sv)
%}
};
%name{Slic3r::Linef3} class Linef3 {
Linef3(Pointf3* a, Pointf3* b)
%code{% RETVAL = new Linef3(*a, *b); %};
~Linef3();
Clone<Linef3> clone()
%code{% RETVAL = THIS; %};
Ref<Pointf3> a()
%code{% RETVAL = &THIS->a; %};
Ref<Pointf3> b()
%code{% RETVAL = &THIS->b; %};
Clone<Pointf3> intersect_plane(double z);
};

View file

@ -20,6 +20,8 @@
void clear_objects();
size_t objects_count()
%code%{ RETVAL = THIS->objects.size(); %};
Ref<ModelObject> get_object(int idx)
%code%{ RETVAL = THIS->objects.at(idx); %};
Ref<ModelMaterial> get_material(t_model_material_id material_id)
%code%{
@ -188,9 +190,9 @@ ModelMaterial::attributes()
void set_layer_height_ranges(t_layer_height_ranges ranges)
%code%{ THIS->layer_height_ranges = ranges; %};
Ref<Pointf> origin_translation()
Ref<Pointf3> origin_translation()
%code%{ RETVAL = &THIS->origin_translation; %};
void set_origin_translation(Pointf* point)
void set_origin_translation(Pointf3* point)
%code%{ THIS->origin_translation = *point; %};
bool needed_repair() const;

View file

@ -31,6 +31,8 @@
%code{% RETVAL = THIS->distance_to(*line); %};
double ccw(Point* p1, Point* p2)
%code{% RETVAL = THIS->ccw(*p1, *p2); %};
double ccw_angle(Point* p1, Point* p2)
%code{% RETVAL = THIS->ccw_angle(*p1, *p2); %};
Clone<Point> projection_onto_polygon(Polygon* polygon)
%code{% RETVAL = new Point(THIS->projection_onto(*polygon)); %};
Clone<Point> projection_onto_polyline(Polyline* polyline)
@ -93,10 +95,18 @@ Point::coincides_with(point_sv)
%code{% RETVAL = THIS->x; %};
double y()
%code{% RETVAL = THIS->y; %};
void set_x(double val)
%code{% THIS->x = val; %};
void set_y(double val)
%code{% THIS->y = val; %};
void translate(double x, double y);
void scale(double factor);
void rotate(double angle, Pointf* center)
%code{% THIS->rotate(angle, *center); %};
Clone<Pointf> negative()
%code{% RETVAL = THIS->negative(); %};
Clone<Pointf> vector_to(Pointf* point)
%code{% RETVAL = THIS->vector_to(*point); %};
};
%name{Slic3r::Pointf3} class Pointf3 {
@ -116,4 +126,12 @@ Point::coincides_with(point_sv)
%code{% THIS->y = val; %};
void set_z(double val)
%code{% THIS->z = val; %};
void translate(double x, double y, double z);
void scale(double factor);
double distance_to(Pointf3* point)
%code{% RETVAL = THIS->distance_to(*point); %};
Clone<Pointf3> negative()
%code{% RETVAL = THIS->negative(); %};
Clone<Pointf3> vector_to(Pointf3* point)
%code{% RETVAL = THIS->vector_to(*point); %};
};

View file

@ -47,6 +47,10 @@
THIS->bounding_box(RETVAL);
%};
std::string wkt();
Points concave_points(double angle)
%code{% THIS->concave_points(angle, &RETVAL); %};
Points convex_points(double angle)
%code{% THIS->convex_points(angle, &RETVAL); %};
%{
Polygon*

View file

@ -61,6 +61,11 @@ _constant()
%code%{ RETVAL = THIS->layer_height_ranges; %};
Ref<Point3> size()
%code%{ RETVAL = &THIS->size; %};
BoundingBox* bounding_box()
%code{%
RETVAL = new BoundingBox();
THIS->bounding_box(RETVAL);
%};
Ref<Point> _copies_shift()
%code%{ RETVAL = &THIS->_copies_shift; %};
@ -83,6 +88,7 @@ _constant()
void set_layer_height_ranges(t_layer_height_ranges layer_height_ranges)
%code%{ THIS->layer_height_ranges = layer_height_ranges; %};
size_t total_layer_count();
size_t layer_count();
void clear_layers();
Ref<Layer> get_layer(int idx);
@ -106,6 +112,8 @@ _constant()
void set_step_started(PrintObjectStep step)
%code%{ THIS->state.set_started(step); %};
void bridge_over_infill();
int ptr()
%code%{ RETVAL = (int)(intptr_t)THIS; %};
};
@ -133,12 +141,6 @@ _constant()
%code%{ RETVAL = &THIS->objects; %};
void clear_objects();
Ref<PrintObject> get_object(int idx);
Ref<PrintObject> add_object(ModelObject* model_object,
BoundingBoxf3 *modobj_bbox)
%code%{ RETVAL = THIS->add_object(model_object, *modobj_bbox); %};
Ref<PrintObject> set_new_object(size_t idx, ModelObject* model_object,
BoundingBoxf3 *modobj_bbox)
%code%{ RETVAL = THIS->set_new_object(idx, model_object, *modobj_bbox); %};
void delete_object(int idx);
void reload_object(int idx);
size_t object_count()
@ -156,6 +158,8 @@ _constant()
bool invalidate_all_steps();
bool step_done(PrintStep step)
%code%{ RETVAL = THIS->state.is_done(step); %};
bool object_step_done(PrintObjectStep step)
%code%{ RETVAL = THIS->step_done(step); %};
void set_step_done(PrintStep step)
%code%{ THIS->state.set_done(step); %};
void set_step_started(PrintStep step)
@ -185,6 +189,11 @@ _constant()
croak("%s\n", e.what());
}
%};
Clone<BoundingBox> bounding_box();
Clone<BoundingBox> total_bounding_box();
double skirt_first_layer_height();
Clone<Flow> brim_flow();
Clone<Flow> skirt_flow();
%{
double

View file

@ -0,0 +1,16 @@
%module{Slic3r::XS};
#include <myinit.h>
#include "libslic3r/SupportMaterial.hpp"
%package{Slic3r::Print::SupportMaterial};
%{
SV*
MARGIN()
PROTOTYPE:
CODE:
RETVAL = newSVnv(SUPPORT_MATERIAL_MARGIN);
OUTPUT: RETVAL
%}

View file

@ -17,6 +17,7 @@
double area();
bool is_solid() const;
bool is_external() const;
bool is_internal() const;
bool is_bottom() const;
bool is_bridge() const;
%{

View file

@ -73,6 +73,10 @@ Line* O_OBJECT_SLIC3R
Ref<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
Ref<Polyline> O_OBJECT_SLIC3R_T
Clone<Polyline> O_OBJECT_SLIC3R_T

View file

@ -60,6 +60,9 @@
%typemap{Line*};
%typemap{Ref<Line>}{simple};
%typemap{Clone<Line>}{simple};
%typemap{Linef3*};
%typemap{Ref<Linef3>}{simple};
%typemap{Clone<Linef3>}{simple};
%typemap{Polyline*};
%typemap{Ref<Polyline>}{simple};
%typemap{Clone<Polyline>}{simple};