mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 15:51:10 -06:00
Merge remote-tracking branch 'origin/dev' into sla_base_pool
This commit is contained in:
commit
d749080261
388 changed files with 115166 additions and 3275 deletions
|
@ -56,15 +56,15 @@ new_from_points(CLASS, points)
|
|||
Clone<BoundingBoxf> clone()
|
||||
%code{% RETVAL = THIS; %};
|
||||
void merge(BoundingBoxf* bb) %code{% THIS->merge(*bb); %};
|
||||
void merge_point(Pointf* point) %code{% THIS->merge(*point); %};
|
||||
void merge_point(Vec2d* point) %code{% THIS->merge(*point); %};
|
||||
void scale(double factor);
|
||||
void translate(double x, double y);
|
||||
Clone<Pointf> size();
|
||||
Clone<Pointf> center();
|
||||
Clone<Vec2d> size();
|
||||
Clone<Vec2d> center();
|
||||
double radius();
|
||||
bool empty() %code{% RETVAL = empty(*THIS); %};
|
||||
Clone<Pointf> min_point() %code{% RETVAL = THIS->min; %};
|
||||
Clone<Pointf> max_point() %code{% RETVAL = THIS->max; %};
|
||||
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); %};
|
||||
|
@ -96,17 +96,17 @@ 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 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(Pointf3* point) %code{% RETVAL = THIS->contains(*point); %};
|
||||
Clone<Pointf3> size();
|
||||
Clone<Pointf3> center();
|
||||
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<Pointf3> min_point() %code{% RETVAL = THIS->min; %};
|
||||
Clone<Pointf3> max_point() %code{% RETVAL = THIS->max; %};
|
||||
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); %};
|
||||
|
|
|
@ -35,9 +35,9 @@
|
|||
}
|
||||
%};
|
||||
|
||||
Ref<Pointf> origin()
|
||||
Ref<Vec2d> origin()
|
||||
%code{% RETVAL = &(THIS->origin()); %};
|
||||
void set_origin(Pointf* pointf)
|
||||
void set_origin(Vec2d* pointf)
|
||||
%code{% THIS->set_origin(*pointf); %};
|
||||
Ref<Point> last_pos()
|
||||
%code{% RETVAL = &(THIS->last_pos()); %};
|
||||
|
|
|
@ -87,6 +87,80 @@ void add_frequently_changed_parameters(SV *ui_parent, SV *ui_sizer, SV *ui_p_siz
|
|||
(wxBoxSizer*)wxPli_sv_2_object(aTHX_ ui_sizer, "Wx::BoxSizer"),
|
||||
(wxFlexGridSizer*)wxPli_sv_2_object(aTHX_ ui_p_sizer, "Wx::FlexGridSizer")); %};
|
||||
|
||||
void add_expert_mode_part( SV *ui_parent, SV *ui_sizer,
|
||||
Model *model,
|
||||
int event_object_selection_changed,
|
||||
int event_object_settings_changed,
|
||||
int event_remove_object,
|
||||
int event_update_scene)
|
||||
%code%{ Slic3r::GUI::add_expert_mode_part( (wxWindow*)wxPli_sv_2_object(aTHX_ ui_parent, "Wx::Window"),
|
||||
(wxBoxSizer*)wxPli_sv_2_object(aTHX_ ui_sizer, "Wx::BoxSizer"),
|
||||
*model,
|
||||
event_object_selection_changed,
|
||||
event_object_settings_changed,
|
||||
event_remove_object,
|
||||
event_update_scene); %};
|
||||
|
||||
void set_objects_from_perl( SV *ui_parent,
|
||||
SV *frequently_changed_parameters_sizer,
|
||||
SV *expert_mode_part_sizer,
|
||||
SV *scrolled_window_sizer,
|
||||
SV *btn_export_gcode,
|
||||
SV *btn_export_stl,
|
||||
SV *btn_reslice,
|
||||
SV *btn_print,
|
||||
SV *btn_send_gcode,
|
||||
SV *manifold_warning_icon)
|
||||
%code%{ Slic3r::GUI::set_objects_from_perl(
|
||||
(wxWindow *)wxPli_sv_2_object(aTHX_ ui_parent, "Wx::Window"),
|
||||
(wxBoxSizer *)wxPli_sv_2_object(aTHX_ frequently_changed_parameters_sizer, "Wx::BoxSizer"),
|
||||
(wxBoxSizer *)wxPli_sv_2_object(aTHX_ expert_mode_part_sizer, "Wx::BoxSizer"),
|
||||
(wxBoxSizer *)wxPli_sv_2_object(aTHX_ scrolled_window_sizer, "Wx::BoxSizer"),
|
||||
(wxButton *)wxPli_sv_2_object(aTHX_ btn_export_gcode, "Wx::Button"),
|
||||
(wxButton *)wxPli_sv_2_object(aTHX_ btn_export_stl, "Wx::Button"),
|
||||
(wxButton *)wxPli_sv_2_object(aTHX_ btn_reslice, "Wx::Button"),
|
||||
(wxButton *)wxPli_sv_2_object(aTHX_ btn_print, "Wx::Button"),
|
||||
(wxButton *)wxPli_sv_2_object(aTHX_ btn_send_gcode, "Wx::Button"),
|
||||
(wxStaticBitmap *)wxPli_sv_2_object(aTHX_ manifold_warning_icon, "Wx::StaticBitmap")); %};
|
||||
|
||||
void set_show_print_info(bool show)
|
||||
%code%{ Slic3r::GUI::set_show_print_info(show); %};
|
||||
|
||||
void set_show_manifold_warning_icon(bool show)
|
||||
%code%{ Slic3r::GUI::set_show_manifold_warning_icon(show); %};
|
||||
|
||||
void update_mode()
|
||||
%code%{ Slic3r::GUI::update_mode(); %};
|
||||
|
||||
void add_object_to_list(const char *name, SV *object_model)
|
||||
%code%{ Slic3r::GUI::add_object_to_list(
|
||||
name,
|
||||
(ModelObject *)wxPli_sv_2_object(aTHX_ object_model, "Slic3r::Model::Object") ); %};
|
||||
|
||||
void delete_object_from_list()
|
||||
%code%{ Slic3r::GUI::delete_object_from_list(); %};
|
||||
|
||||
void delete_all_objects_from_list()
|
||||
%code%{ Slic3r::GUI::delete_all_objects_from_list(); %};
|
||||
|
||||
void set_object_count(int idx, int count)
|
||||
%code%{ Slic3r::GUI::set_object_count(idx, count); %};
|
||||
|
||||
void set_object_scale(int idx, int scale)
|
||||
%code%{ Slic3r::GUI::set_object_scale(idx, scale); %};
|
||||
|
||||
void unselect_objects()
|
||||
%code%{ Slic3r::GUI::unselect_objects(); %};
|
||||
|
||||
void select_current_object(int idx)
|
||||
%code%{ Slic3r::GUI::select_current_object(idx); %};
|
||||
|
||||
void remove_obj()
|
||||
%code%{ Slic3r::GUI::remove(); %};
|
||||
|
||||
void update_rotation_value(double angle, const char *axis)
|
||||
%code%{ Slic3r::GUI::update_rotation_value(angle, axis); %};
|
||||
|
||||
std::string fold_utf8_to_ascii(const char *src)
|
||||
%code%{ RETVAL = Slic3r::fold_utf8_to_ascii(src); %};
|
||||
|
||||
|
|
|
@ -55,13 +55,12 @@
|
|||
int object_idx() const;
|
||||
int volume_idx() const;
|
||||
int instance_idx() const;
|
||||
Clone<Pointf3> origin() const
|
||||
Clone<Vec3d> origin() const
|
||||
%code%{ RETVAL = THIS->get_origin(); %};
|
||||
void translate(double x, double y, double z)
|
||||
%code%{ THIS->set_origin(THIS->get_origin() + Pointf3(x, y, z)); %};
|
||||
%code%{ THIS->set_origin(THIS->get_origin() + Vec3d(x, y, z)); %};
|
||||
Clone<BoundingBoxf3> bounding_box() const
|
||||
%code%{ RETVAL = THIS->bounding_box; %};
|
||||
Clone<BoundingBoxf3> transformed_bounding_box() const;
|
||||
|
||||
bool empty() const;
|
||||
bool indexed() const;
|
||||
|
@ -419,6 +418,13 @@ enable_shader(canvas, enable)
|
|||
CODE:
|
||||
_3DScene::enable_shader((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
|
||||
|
||||
void
|
||||
enable_toolbar(canvas, enable)
|
||||
SV *canvas;
|
||||
bool enable;
|
||||
CODE:
|
||||
_3DScene::enable_toolbar((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
|
||||
|
||||
void
|
||||
enable_force_zoom_to_bed(canvas, enable)
|
||||
SV *canvas;
|
||||
|
@ -440,6 +446,23 @@ allow_multisample(canvas, allow)
|
|||
CODE:
|
||||
_3DScene::allow_multisample((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), allow);
|
||||
|
||||
void
|
||||
enable_toolbar_item(canvas, item, enable)
|
||||
SV *canvas;
|
||||
std::string item;
|
||||
bool enable;
|
||||
CODE:
|
||||
_3DScene::enable_toolbar_item((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), item, enable);
|
||||
|
||||
bool
|
||||
is_toolbar_item_pressed(canvas, item)
|
||||
SV *canvas;
|
||||
std::string item;
|
||||
CODE:
|
||||
RETVAL = _3DScene::is_toolbar_item_pressed((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), item);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
void
|
||||
zoom_to_bed(canvas)
|
||||
SV *canvas;
|
||||
|
@ -626,7 +649,77 @@ register_on_update_geometry_info_callback(canvas, callback)
|
|||
SV *callback;
|
||||
CODE:
|
||||
_3DScene::register_on_update_geometry_info_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
|
||||
|
||||
|
||||
void
|
||||
register_action_add_callback(canvas, callback)
|
||||
SV *canvas;
|
||||
SV *callback;
|
||||
CODE:
|
||||
_3DScene::register_action_add_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
|
||||
|
||||
void
|
||||
register_action_delete_callback(canvas, callback)
|
||||
SV *canvas;
|
||||
SV *callback;
|
||||
CODE:
|
||||
_3DScene::register_action_delete_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
|
||||
|
||||
void
|
||||
register_action_deleteall_callback(canvas, callback)
|
||||
SV *canvas;
|
||||
SV *callback;
|
||||
CODE:
|
||||
_3DScene::register_action_deleteall_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
|
||||
|
||||
void
|
||||
register_action_arrange_callback(canvas, callback)
|
||||
SV *canvas;
|
||||
SV *callback;
|
||||
CODE:
|
||||
_3DScene::register_action_arrange_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
|
||||
|
||||
void
|
||||
register_action_more_callback(canvas, callback)
|
||||
SV *canvas;
|
||||
SV *callback;
|
||||
CODE:
|
||||
_3DScene::register_action_more_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
|
||||
|
||||
void
|
||||
register_action_fewer_callback(canvas, callback)
|
||||
SV *canvas;
|
||||
SV *callback;
|
||||
CODE:
|
||||
_3DScene::register_action_fewer_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
|
||||
|
||||
void
|
||||
register_action_split_callback(canvas, callback)
|
||||
SV *canvas;
|
||||
SV *callback;
|
||||
CODE:
|
||||
_3DScene::register_action_split_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
|
||||
|
||||
void
|
||||
register_action_cut_callback(canvas, callback)
|
||||
SV *canvas;
|
||||
SV *callback;
|
||||
CODE:
|
||||
_3DScene::register_action_cut_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
|
||||
|
||||
void
|
||||
register_action_settings_callback(canvas, callback)
|
||||
SV *canvas;
|
||||
SV *callback;
|
||||
CODE:
|
||||
_3DScene::register_action_settings_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
|
||||
|
||||
void
|
||||
register_action_layersediting_callback(canvas, callback)
|
||||
SV *canvas;
|
||||
SV *callback;
|
||||
CODE:
|
||||
_3DScene::register_action_layersediting_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
|
||||
|
||||
void
|
||||
reset_legend_texture()
|
||||
CODE:
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
%name{Slic3r::GUI::PresetCollection} class PresetCollection {
|
||||
|
||||
Ref<Preset> preset(size_t idx) %code%{ RETVAL = &THIS->preset(idx); %};
|
||||
Ref<Preset> default_preset() %code%{ RETVAL = &THIS->default_preset(); %};
|
||||
size_t size() const;
|
||||
size_t num_visible() const;
|
||||
std::string name() const;
|
||||
|
@ -133,6 +132,7 @@ PresetCollection::arrayref()
|
|||
|
||||
Ref<PresetCollection> print() %code%{ RETVAL = &THIS->prints; %};
|
||||
Ref<PresetCollection> filament() %code%{ RETVAL = &THIS->filaments; %};
|
||||
Ref<PresetCollection> sla_material() %code%{ RETVAL = &THIS->sla_materials; %};
|
||||
Ref<PresetCollection> printer() %code%{ RETVAL = &THIS->printers; %};
|
||||
Ref<DynamicPrintConfig> project_config() %code%{ RETVAL = &THIS->project_config; %};
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
%package{Slic3r::Geometry};
|
||||
|
||||
Pointfs arrange(size_t total_parts, Pointf* part, coordf_t dist, BoundingBoxf* bb = NULL)
|
||||
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))
|
||||
|
|
|
@ -78,15 +78,15 @@ Line::coincides_with(line_sv)
|
|||
|
||||
|
||||
%name{Slic3r::Linef3} class Linef3 {
|
||||
Linef3(Pointf3* a, Pointf3* b)
|
||||
Linef3(Vec3d* a, Vec3d* b)
|
||||
%code{% RETVAL = new Linef3(*a, *b); %};
|
||||
~Linef3();
|
||||
Clone<Linef3> clone()
|
||||
%code{% RETVAL = THIS; %};
|
||||
Ref<Pointf3> a()
|
||||
Ref<Vec3d> a()
|
||||
%code{% RETVAL = &THIS->a; %};
|
||||
Ref<Pointf3> b()
|
||||
Ref<Vec3d> b()
|
||||
%code{% RETVAL = &THIS->b; %};
|
||||
Clone<Pointf3> intersect_plane(double z);
|
||||
Clone<Vec3d> intersect_plane(double z);
|
||||
void scale(double factor);
|
||||
};
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
|
||||
bool add_default_instances();
|
||||
Clone<BoundingBoxf3> bounding_box();
|
||||
void center_instances_around_point(Pointf* point)
|
||||
void center_instances_around_point(Vec2d* point)
|
||||
%code%{ THIS->center_instances_around_point(*point); %};
|
||||
void translate(double x, double y, double z);
|
||||
Clone<TriangleMesh> mesh();
|
||||
|
@ -289,9 +289,9 @@ ModelMaterial::attributes()
|
|||
void set_layer_height_profile(std::vector<double> profile)
|
||||
%code%{ THIS->layer_height_profile = profile; THIS->layer_height_profile_valid = true; %};
|
||||
|
||||
Ref<Pointf3> origin_translation()
|
||||
Ref<Vec3d> origin_translation()
|
||||
%code%{ RETVAL = &THIS->origin_translation; %};
|
||||
void set_origin_translation(Pointf3* point)
|
||||
void set_origin_translation(Vec3d* point)
|
||||
%code%{ THIS->origin_translation = *point; %};
|
||||
|
||||
bool needed_repair() const;
|
||||
|
@ -299,7 +299,7 @@ ModelMaterial::attributes()
|
|||
int facets_count();
|
||||
void center_around_origin();
|
||||
void translate(double x, double y, double z);
|
||||
void scale_xyz(Pointf3* versor)
|
||||
void scale_xyz(Vec3d* versor)
|
||||
%code{% THIS->scale(*versor); %};
|
||||
void rotate(float angle, Axis axis);
|
||||
void mirror(Axis axis);
|
||||
|
@ -357,14 +357,14 @@ ModelMaterial::attributes()
|
|||
%code%{ RETVAL = THIS->rotation; %};
|
||||
double scaling_factor()
|
||||
%code%{ RETVAL = THIS->scaling_factor; %};
|
||||
Ref<Pointf> offset()
|
||||
Ref<Vec2d> offset()
|
||||
%code%{ RETVAL = &THIS->offset; %};
|
||||
|
||||
void set_rotation(double val)
|
||||
%code%{ THIS->rotation = val; THIS->get_object()->invalidate_bounding_box(); %};
|
||||
void set_scaling_factor(double val)
|
||||
%code%{ THIS->scaling_factor = val; THIS->get_object()->invalidate_bounding_box(); %};
|
||||
void set_offset(Pointf *offset)
|
||||
void set_offset(Vec2d *offset)
|
||||
%code%{ THIS->offset = *offset; %};
|
||||
|
||||
void transform_mesh(TriangleMesh* mesh, bool dont_translate = false) const;
|
||||
|
|
|
@ -77,24 +77,10 @@ Point::coincides_with(point_sv)
|
|||
|
||||
};
|
||||
|
||||
%name{Slic3r::Point3} class Point3 {
|
||||
Point3(int _x = 0, int _y = 0, int _z = 0);
|
||||
~Point3();
|
||||
Clone<Point3> clone()
|
||||
%code{% RETVAL = THIS; %};
|
||||
int x()
|
||||
%code{% RETVAL = (*THIS)(0); %};
|
||||
int y()
|
||||
%code{% RETVAL = (*THIS)(1); %};
|
||||
int z()
|
||||
%code{% RETVAL = (*THIS)(2); %};
|
||||
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%ld,%ld,%ld", (*THIS)(0), (*THIS)(1), (*THIS)(2)); RETVAL = buf; %};
|
||||
};
|
||||
|
||||
%name{Slic3r::Pointf} class Pointf {
|
||||
Pointf(double _x = 0, double _y = 0);
|
||||
~Pointf();
|
||||
Clone<Pointf> clone()
|
||||
%name{Slic3r::Pointf} class Vec2d {
|
||||
Vec2d(double _x = 0, double _y = 0);
|
||||
~Vec2d();
|
||||
Clone<Vec2d> clone()
|
||||
%code{% RETVAL = THIS; %};
|
||||
SV* arrayref()
|
||||
%code{% RETVAL = to_SV_pureperl(THIS); %};
|
||||
|
@ -109,22 +95,22 @@ Point::coincides_with(point_sv)
|
|||
void set_y(double val)
|
||||
%code{% (*THIS)(1) = val; %};
|
||||
void translate(double x, double y)
|
||||
%code{% *THIS += Pointf(x, y); %};
|
||||
%code{% *THIS += Vec2d(x, y); %};
|
||||
void scale(double factor)
|
||||
%code{% *THIS *= factor; %};
|
||||
void rotate(double angle, Pointf* center)
|
||||
%code{% THIS->rotate(angle, *center); %};
|
||||
Pointf* negative()
|
||||
%code{% RETVAL = new Pointf(- *THIS); %};
|
||||
Pointf* vector_to(Pointf* point)
|
||||
%code{% RETVAL = new Pointf(*point - *THIS); %};
|
||||
void rotate(double angle, Vec2d* center)
|
||||
%code{% *THIS = Eigen::Translation2d(*center) * Eigen::Rotation2Dd(angle) * Eigen::Translation2d(- *center) * Eigen::Vector2d((*THIS)(0), (*THIS)(1)); %};
|
||||
Vec2d* negative()
|
||||
%code{% RETVAL = new Vec2d(- *THIS); %};
|
||||
Vec2d* vector_to(Vec2d* point)
|
||||
%code{% RETVAL = new Vec2d(*point - *THIS); %};
|
||||
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf", (*THIS)(0), (*THIS)(1)); RETVAL = buf; %};
|
||||
};
|
||||
|
||||
%name{Slic3r::Pointf3} class Pointf3 {
|
||||
Pointf3(double _x = 0, double _y = 0, double _z = 0);
|
||||
~Pointf3();
|
||||
Clone<Pointf3> clone()
|
||||
%name{Slic3r::Pointf3} class Vec3d {
|
||||
Vec3d(double _x = 0, double _y = 0, double _z = 0);
|
||||
~Vec3d();
|
||||
Clone<Vec3d> clone()
|
||||
%code{% RETVAL = THIS; %};
|
||||
double x()
|
||||
%code{% RETVAL = (*THIS)(0); %};
|
||||
|
@ -139,14 +125,14 @@ Point::coincides_with(point_sv)
|
|||
void set_z(double val)
|
||||
%code{% (*THIS)(2) = val; %};
|
||||
void translate(double x, double y, double z)
|
||||
%code{% *THIS += Pointf3(x, y, z); %};
|
||||
%code{% *THIS += Vec3d(x, y, z); %};
|
||||
void scale(double factor)
|
||||
%code{% *THIS *= factor; %};
|
||||
double distance_to(Pointf3* point)
|
||||
double distance_to(Vec3d* point)
|
||||
%code{% RETVAL = (*point - *THIS).norm(); %};
|
||||
Pointf3* negative()
|
||||
%code{% RETVAL = new Pointf3(- *THIS); %};
|
||||
Pointf3* vector_to(Pointf3* point)
|
||||
%code{% RETVAL = new Pointf3(*point - *THIS); %};
|
||||
Vec3d* negative()
|
||||
%code{% RETVAL = new Vec3d(- *THIS); %};
|
||||
Vec3d* vector_to(Vec3d* point)
|
||||
%code{% RETVAL = new Vec3d(*point - *THIS); %};
|
||||
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf,%lf", (*THIS)(0), (*THIS)(1), (*THIS)(2)); RETVAL = buf; %};
|
||||
};
|
||||
|
|
|
@ -63,8 +63,6 @@ _constant()
|
|||
%code%{ RETVAL = THIS->layer_height_ranges; %};
|
||||
std::vector<double> layer_height_profile()
|
||||
%code%{ RETVAL = THIS->layer_height_profile; %};
|
||||
Ref<Point3> size()
|
||||
%code%{ RETVAL = &THIS->size; %};
|
||||
Clone<BoundingBox> bounding_box();
|
||||
|
||||
Points _shifted_copies()
|
||||
|
@ -72,7 +70,7 @@ _constant()
|
|||
void set_shifted_copies(Points value)
|
||||
%code%{ THIS->_shifted_copies = value; %};
|
||||
|
||||
bool add_copy(Pointf* point)
|
||||
bool add_copy(Vec2d* point)
|
||||
%code%{ RETVAL = THIS->add_copy(*point); %};
|
||||
bool delete_last_copy();
|
||||
bool delete_all_copies();
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
void repair();
|
||||
void WriteOBJFile(char* output_file);
|
||||
void scale(float factor);
|
||||
void scale_xyz(Pointf3* versor)
|
||||
void scale_xyz(Vec3d* versor)
|
||||
%code{% THIS->scale(*versor); %};
|
||||
void translate(float x, float y, float z);
|
||||
void rotate_x(float angle);
|
||||
|
@ -33,7 +33,7 @@
|
|||
ExPolygons horizontal_projection();
|
||||
Clone<Polygon> convex_hull();
|
||||
Clone<BoundingBoxf3> bounding_box();
|
||||
Clone<Pointf3> center()
|
||||
Clone<Vec3d> center()
|
||||
%code{% RETVAL = THIS->bounding_box().center(); %};
|
||||
int facets_count();
|
||||
void reset_repair_stats();
|
||||
|
@ -60,14 +60,14 @@ TriangleMesh::ReadFromPerl(vertices, facets)
|
|||
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;
|
||||
facet.normal(0) = 0;
|
||||
facet.normal(1) = 0;
|
||||
facet.normal(2) = 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.vertex[v](0) = SvNV(*av_fetch(vertex_av, 0, 0));
|
||||
facet.vertex[v](1) = SvNV(*av_fetch(vertex_av, 1, 0));
|
||||
facet.vertex[v](2) = SvNV(*av_fetch(vertex_av, 2, 0));
|
||||
}
|
||||
facet.extra[0] = 0;
|
||||
facet.extra[1] = 0;
|
||||
|
@ -110,9 +110,9 @@ TriangleMesh::vertices()
|
|||
AV* vertex = newAV();
|
||||
av_store(vertices, i, newRV_noinc((SV*)vertex));
|
||||
av_extend(vertex, 2);
|
||||
av_store(vertex, 0, newSVnv(THIS->stl.v_shared[i].x));
|
||||
av_store(vertex, 1, newSVnv(THIS->stl.v_shared[i].y));
|
||||
av_store(vertex, 2, newSVnv(THIS->stl.v_shared[i].z));
|
||||
av_store(vertex, 0, newSVnv(THIS->stl.v_shared[i](0)));
|
||||
av_store(vertex, 1, newSVnv(THIS->stl.v_shared[i](1)));
|
||||
av_store(vertex, 2, newSVnv(THIS->stl.v_shared[i](2)));
|
||||
}
|
||||
|
||||
RETVAL = newRV_noinc((SV*)vertices);
|
||||
|
@ -155,9 +155,9 @@ TriangleMesh::normals()
|
|||
AV* facet = newAV();
|
||||
av_store(normals, i, newRV_noinc((SV*)facet));
|
||||
av_extend(facet, 2);
|
||||
av_store(facet, 0, newSVnv(THIS->stl.facet_start[i].normal.x));
|
||||
av_store(facet, 1, newSVnv(THIS->stl.facet_start[i].normal.y));
|
||||
av_store(facet, 2, newSVnv(THIS->stl.facet_start[i].normal.z));
|
||||
av_store(facet, 0, newSVnv(THIS->stl.facet_start[i].normal(0)));
|
||||
av_store(facet, 1, newSVnv(THIS->stl.facet_start[i].normal(1)));
|
||||
av_store(facet, 2, newSVnv(THIS->stl.facet_start[i].normal(2)));
|
||||
}
|
||||
|
||||
RETVAL = newRV_noinc((SV*)normals);
|
||||
|
@ -169,9 +169,9 @@ TriangleMesh::size()
|
|||
CODE:
|
||||
AV* size = newAV();
|
||||
av_extend(size, 2);
|
||||
av_store(size, 0, newSVnv(THIS->stl.stats.size.x));
|
||||
av_store(size, 1, newSVnv(THIS->stl.stats.size.y));
|
||||
av_store(size, 2, newSVnv(THIS->stl.stats.size.z));
|
||||
av_store(size, 0, newSVnv(THIS->stl.stats.size(0)));
|
||||
av_store(size, 1, newSVnv(THIS->stl.stats.size(1)));
|
||||
av_store(size, 2, newSVnv(THIS->stl.stats.size(2)));
|
||||
RETVAL = newRV_noinc((SV*)size);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
@ -216,12 +216,12 @@ TriangleMesh::cut(z, upper, lower)
|
|||
std::vector<double>
|
||||
TriangleMesh::bb3()
|
||||
CODE:
|
||||
RETVAL.push_back(THIS->stl.stats.min.x);
|
||||
RETVAL.push_back(THIS->stl.stats.min.y);
|
||||
RETVAL.push_back(THIS->stl.stats.max.x);
|
||||
RETVAL.push_back(THIS->stl.stats.max.y);
|
||||
RETVAL.push_back(THIS->stl.stats.min.z);
|
||||
RETVAL.push_back(THIS->stl.stats.max.z);
|
||||
RETVAL.push_back(THIS->stl.stats.min(0));
|
||||
RETVAL.push_back(THIS->stl.stats.min(1));
|
||||
RETVAL.push_back(THIS->stl.stats.max(0));
|
||||
RETVAL.push_back(THIS->stl.stats.max(1));
|
||||
RETVAL.push_back(THIS->stl.stats.min(2));
|
||||
RETVAL.push_back(THIS->stl.stats.max(2));
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
%module{Slic3r::XS};
|
||||
|
||||
%{
|
||||
#include <xsinit.h>
|
||||
#include "slic3r/Utils/OctoPrint.hpp"
|
||||
%}
|
||||
|
||||
%name{Slic3r::OctoPrint} class OctoPrint {
|
||||
OctoPrint(DynamicPrintConfig *config);
|
||||
~OctoPrint();
|
||||
|
||||
bool send_gcode(std::string filename) const;
|
||||
};
|
12
xs/xsp/Utils_PrintHost.xsp
Normal file
12
xs/xsp/Utils_PrintHost.xsp
Normal file
|
@ -0,0 +1,12 @@
|
|||
%module{Slic3r::XS};
|
||||
|
||||
%{
|
||||
#include <xsinit.h>
|
||||
#include "slic3r/Utils/PrintHost.hpp"
|
||||
%}
|
||||
|
||||
%name{Slic3r::PrintHost} class PrintHost {
|
||||
bool send_gcode(std::string filename) const;
|
||||
|
||||
static PrintHost* get_print_host(DynamicPrintConfig *config);
|
||||
};
|
|
@ -66,13 +66,13 @@ Point3* O_OBJECT_SLIC3R
|
|||
Ref<Point3> O_OBJECT_SLIC3R_T
|
||||
Clone<Point3> O_OBJECT_SLIC3R_T
|
||||
|
||||
Pointf* O_OBJECT_SLIC3R
|
||||
Ref<Pointf> O_OBJECT_SLIC3R_T
|
||||
Clone<Pointf> O_OBJECT_SLIC3R_T
|
||||
Vec2d* O_OBJECT_SLIC3R
|
||||
Ref<Vec2d> O_OBJECT_SLIC3R_T
|
||||
Clone<Vec2d> O_OBJECT_SLIC3R_T
|
||||
|
||||
Pointf3* O_OBJECT_SLIC3R
|
||||
Ref<Pointf3> O_OBJECT_SLIC3R_T
|
||||
Clone<Pointf3> O_OBJECT_SLIC3R_T
|
||||
Vec3d* O_OBJECT_SLIC3R
|
||||
Ref<Vec3d> O_OBJECT_SLIC3R_T
|
||||
Clone<Vec3d> O_OBJECT_SLIC3R_T
|
||||
|
||||
Line* O_OBJECT_SLIC3R
|
||||
Ref<Line> O_OBJECT_SLIC3R_T
|
||||
|
@ -239,9 +239,7 @@ Ref<TabIface> O_OBJECT_SLIC3R_T
|
|||
PresetUpdater* O_OBJECT_SLIC3R
|
||||
Ref<PresetUpdater> O_OBJECT_SLIC3R_T
|
||||
|
||||
OctoPrint* O_OBJECT_SLIC3R
|
||||
Ref<OctoPrint> O_OBJECT_SLIC3R_T
|
||||
Clone<OctoPrint> O_OBJECT_SLIC3R_T
|
||||
PrintHost* O_OBJECT_SLIC3R
|
||||
|
||||
Axis T_UV
|
||||
ExtrusionLoopRole T_UV
|
||||
|
|
|
@ -22,12 +22,12 @@
|
|||
%typemap{Point3*};
|
||||
%typemap{Ref<Point3>}{simple};
|
||||
%typemap{Clone<Point3>}{simple};
|
||||
%typemap{Pointf*};
|
||||
%typemap{Ref<Pointf>}{simple};
|
||||
%typemap{Clone<Pointf>}{simple};
|
||||
%typemap{Pointf3*};
|
||||
%typemap{Ref<Pointf3>}{simple};
|
||||
%typemap{Clone<Pointf3>}{simple};
|
||||
%typemap{Vec2d*};
|
||||
%typemap{Ref<Vec2d>}{simple};
|
||||
%typemap{Clone<Vec2d>}{simple};
|
||||
%typemap{Vec3d*};
|
||||
%typemap{Ref<Vec3d>}{simple};
|
||||
%typemap{Clone<Vec3d>}{simple};
|
||||
%typemap{BoundingBox*};
|
||||
%typemap{Ref<BoundingBox>}{simple};
|
||||
%typemap{Clone<BoundingBox>}{simple};
|
||||
|
@ -270,3 +270,4 @@
|
|||
};
|
||||
%typemap{AppController*};
|
||||
%typemap{PrintController*};
|
||||
%typemap{PrintHost*};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue