Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2018-08-16 14:54:56 +0300
committerEnrico Turri <enricoturri@seznam.cz>2018-08-16 14:54:56 +0300
commit115744b38d452c8764bdf14c75692712e580c54d (patch)
treec818b6cc3567b5a407da36c176991b4c7f47e2b9 /xs/src/slic3r/GUI/3DScene.cpp
parentda42b42a6cd110518cf7f8fad5a945d9d0b20574 (diff)
parent1fff2252bce88b4a7099f6347d7b264ecb793571 (diff)
Merge branch 'convex_hull' of https://github.com/prusa3d/Slic3r into gizmos_3d
Diffstat (limited to 'xs/src/slic3r/GUI/3DScene.cpp')
-rw-r--r--xs/src/slic3r/GUI/3DScene.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/xs/src/slic3r/GUI/3DScene.cpp b/xs/src/slic3r/GUI/3DScene.cpp
index 5bb0a3be9..dd7a3fb4a 100644
--- a/xs/src/slic3r/GUI/3DScene.cpp
+++ b/xs/src/slic3r/GUI/3DScene.cpp
@@ -204,6 +204,7 @@ GLVolume::GLVolume(float r, float g, float b, float a)
, m_scale_factor(1.0f)
, m_transformed_bounding_box_dirty(true)
, m_transformed_convex_hull_bounding_box_dirty(true)
+ , m_convex_hull(nullptr)
, composite_id(-1)
, select_group_id(-1)
, drag_group_id(-1)
@@ -293,7 +294,7 @@ void GLVolume::set_scale_factor(float scale_factor)
void GLVolume::set_convex_hull(const TriangleMesh& convex_hull)
{
- m_convex_hull = convex_hull;
+ m_convex_hull = &convex_hull;
}
std::vector<float> GLVolume::world_matrix() const
@@ -322,8 +323,8 @@ BoundingBoxf3 GLVolume::transformed_convex_hull_bounding_box() const
{
if (m_transformed_convex_hull_bounding_box_dirty)
{
- if (m_convex_hull.stl.stats.number_of_facets > 0)
- m_transformed_convex_hull_bounding_box = m_convex_hull.transformed_bounding_box(world_matrix());
+ if ((m_convex_hull != nullptr) && (m_convex_hull->stl.stats.number_of_facets > 0))
+ m_transformed_convex_hull_bounding_box = m_convex_hull->transformed_bounding_box(world_matrix());
else
m_transformed_convex_hull_bounding_box = bounding_box.transformed(world_matrix());
@@ -747,7 +748,6 @@ int GLVolumeCollection::load_wipe_tower_preview(
v.drag_group_id = obj_idx * 1000;
v.is_wipe_tower = true;
v.shader_outside_printer_detection_enabled = ! size_unknown;
- v.set_convex_hull(mesh.convex_hull_3d());
return int(this->volumes.size() - 1);
}
@@ -833,7 +833,7 @@ bool GLVolumeCollection::check_outside_state(const DynamicPrintConfig* config, M
for (GLVolume* volume : this->volumes)
{
- if ((volume != nullptr) && !volume->is_modifier)
+ if ((volume != nullptr) && !volume->is_modifier && (!volume->is_wipe_tower || (volume->is_wipe_tower && volume->shader_outside_printer_detection_enabled)))
{
const BoundingBoxf3& bb = volume->transformed_convex_hull_bounding_box();
bool contained = print_volume.contains(bb);