Skip to content

Commit

Permalink
Fixed prusa3d#1244 - perl part
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoturri1966 committed Sep 26, 2018
1 parent cce5f32 commit 3835a1c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ sub on_btn_load {
# apply the same translation we applied to the object
if (($delta_x != 0.0) || ($delta_y != 0.0) || ($delta_z != 0.0)) {
$new_volume->mesh->translate($delta_x, $delta_y, $delta_z);
$new_volume->convex_hull->translate($delta_x, $delta_y, $delta_z);
}

# set a default extruder value, since user can't add it manually
Expand Down
5 changes: 5 additions & 0 deletions xs/src/libslic3r/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,11 @@ const TriangleMesh& ModelVolume::get_convex_hull() const
return m_convex_hull;
}

TriangleMesh& ModelVolume::get_convex_hull()
{
return m_convex_hull;
}

ModelVolume::Type ModelVolume::type_from_string(const std::string &s)
{
// Legacy support
Expand Down
1 change: 1 addition & 0 deletions xs/src/libslic3r/Model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ class ModelVolume

void calculate_convex_hull();
const TriangleMesh& get_convex_hull() const;
TriangleMesh& get_convex_hull();

// Helpers for loading / storing into AMF / 3MF files.
static Type type_from_string(const std::string &s);
Expand Down
2 changes: 2 additions & 0 deletions xs/xsp/Model.xsp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ ModelMaterial::attributes()
%code%{ RETVAL = &THIS->config; %};
Ref<TriangleMesh> mesh()
%code%{ RETVAL = &THIS->mesh; %};
Ref<TriangleMesh> convex_hull()
%code%{ RETVAL = &THIS->get_convex_hull(); %};

bool modifier()
%code%{ RETVAL = THIS->is_modifier(); %};
Expand Down

0 comments on commit 3835a1c

Please sign in to comment.