mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-12 04:41:48 +08:00
Out of print volume detection for extrusion toolpaths only
This commit is contained in:
parent
b5b7894a6f
commit
c2ab8c2ae3
@ -215,6 +215,7 @@ GLVolume::GLVolume(float r, float g, float b, float a)
|
|||||||
, hover(false)
|
, hover(false)
|
||||||
, is_modifier(false)
|
, is_modifier(false)
|
||||||
, is_wipe_tower(false)
|
, is_wipe_tower(false)
|
||||||
|
, is_extrusion_path(false)
|
||||||
, tverts_range(0, size_t(-1))
|
, tverts_range(0, size_t(-1))
|
||||||
, qverts_range(0, size_t(-1))
|
, qverts_range(0, size_t(-1))
|
||||||
{
|
{
|
||||||
|
@ -299,6 +299,8 @@ public:
|
|||||||
bool is_modifier;
|
bool is_modifier;
|
||||||
// Wheter or not this volume has been generated from the wipe tower
|
// Wheter or not this volume has been generated from the wipe tower
|
||||||
bool is_wipe_tower;
|
bool is_wipe_tower;
|
||||||
|
// Wheter or not this volume has been generated from an extrusion path
|
||||||
|
bool is_extrusion_path;
|
||||||
|
|
||||||
// Interleaved triangles & normals with indexed triangles & quads.
|
// Interleaved triangles & normals with indexed triangles & quads.
|
||||||
GLIndexedVertexArray indexed_vertex_array;
|
GLIndexedVertexArray indexed_vertex_array;
|
||||||
|
@ -1828,7 +1828,6 @@ unsigned int GLCanvas3D::get_volumes_count() const
|
|||||||
|
|
||||||
void GLCanvas3D::reset_volumes()
|
void GLCanvas3D::reset_volumes()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!m_volumes.empty())
|
if (!m_volumes.empty())
|
||||||
{
|
{
|
||||||
// ensures this canvas is current
|
// ensures this canvas is current
|
||||||
@ -1839,6 +1838,9 @@ void GLCanvas3D::reset_volumes()
|
|||||||
m_volumes.clear();
|
m_volumes.clear();
|
||||||
m_dirty = true;
|
m_dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enable_warning_texture(false);
|
||||||
|
_reset_warning_texture();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLCanvas3D::deselect_volumes()
|
void GLCanvas3D::deselect_volumes()
|
||||||
@ -2377,6 +2379,12 @@ void GLCanvas3D::load_preview(const std::vector<std::string>& str_tool_colors)
|
|||||||
if (object != nullptr)
|
if (object != nullptr)
|
||||||
_load_print_object_toolpaths(*object, str_tool_colors);
|
_load_print_object_toolpaths(*object, str_tool_colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (GLVolume* volume : m_volumes.volumes)
|
||||||
|
{
|
||||||
|
volume->is_extrusion_path = true;
|
||||||
|
}
|
||||||
|
|
||||||
_update_toolpath_volumes_outside_state();
|
_update_toolpath_volumes_outside_state();
|
||||||
_show_warning_texture_if_needed();
|
_show_warning_texture_if_needed();
|
||||||
reset_legend_texture();
|
reset_legend_texture();
|
||||||
@ -4276,6 +4284,7 @@ void GLCanvas3D::_load_gcode_extrusion_paths(const GCodePreviewData& preview_dat
|
|||||||
if (volume != nullptr)
|
if (volume != nullptr)
|
||||||
{
|
{
|
||||||
filter.volume = volume;
|
filter.volume = volume;
|
||||||
|
volume->is_extrusion_path = true;
|
||||||
m_volumes.volumes.emplace_back(volume);
|
m_volumes.volumes.emplace_back(volume);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4757,7 +4766,7 @@ void GLCanvas3D::_update_toolpath_volumes_outside_state()
|
|||||||
|
|
||||||
for (GLVolume* volume : m_volumes.volumes)
|
for (GLVolume* volume : m_volumes.volumes)
|
||||||
{
|
{
|
||||||
volume->is_outside = (print_volume.radius() > 0.0) ? !print_volume.contains(volume->transformed_bounding_box()) : false;
|
volume->is_outside = ((print_volume.radius() > 0.0) && volume->is_extrusion_path) ? !print_volume.contains(volume->bounding_box) : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user