FIX: tree support + raft may fail to slice
Do not skip generate_toolpaths if has no overhang but has raft. Jira: STUDIO-4341 Change-Id: I0bdadb5f778e0e1fda686341c0860d0f0c160f0f
This commit is contained in:
parent
ae53c50098
commit
855c3d61ff
|
@ -1183,19 +1183,25 @@ void TreeSupport::detect_overhangs(bool detect_first_sharp_tail_only)
|
||||||
|
|
||||||
void TreeSupport::create_tree_support_layers()
|
void TreeSupport::create_tree_support_layers()
|
||||||
{
|
{
|
||||||
|
{ //create raft layers
|
||||||
int layer_id = 0;
|
int layer_id = 0;
|
||||||
coordf_t raft_print_z = 0.f;
|
coordf_t raft_print_z = 0.f;
|
||||||
coordf_t raft_slice_z = 0.f;
|
coordf_t raft_slice_z = 0.f;
|
||||||
for (; layer_id < m_slicing_params.base_raft_layers; layer_id++) {
|
// Insert the base layers.
|
||||||
raft_print_z += m_slicing_params.base_raft_layer_height;
|
for (size_t i = 0; i < m_slicing_params.base_raft_layers; i++, layer_id++) {
|
||||||
raft_slice_z = raft_print_z - m_slicing_params.base_raft_layer_height / 2;
|
// 1st layer should use first_print_layer_height
|
||||||
m_object->add_tree_support_layer(layer_id, m_slicing_params.base_raft_layer_height, raft_print_z, raft_slice_z);
|
coordf_t height = i == 0 ? m_slicing_params.first_print_layer_height : m_slicing_params.base_raft_layer_height;
|
||||||
|
raft_print_z += height;
|
||||||
|
raft_slice_z = raft_print_z - height / 2;
|
||||||
|
m_object->add_tree_support_layer(layer_id, height, raft_print_z, raft_slice_z);
|
||||||
|
}
|
||||||
|
// Insert the interface layers.
|
||||||
|
for (size_t i = 0; i < m_slicing_params.interface_raft_layers; i++, layer_id++) {
|
||||||
|
coordf_t height = m_slicing_params.interface_raft_layer_height;
|
||||||
|
raft_print_z += height;
|
||||||
|
raft_slice_z = raft_print_z - height / 2;
|
||||||
|
m_object->add_tree_support_layer(layer_id, height, raft_print_z, raft_slice_z);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; layer_id < m_slicing_params.base_raft_layers + m_slicing_params.interface_raft_layers; layer_id++) {
|
|
||||||
raft_print_z += m_slicing_params.interface_raft_layer_height;
|
|
||||||
raft_slice_z = raft_print_z - m_slicing_params.interface_raft_layer_height / 2;
|
|
||||||
m_object->add_tree_support_layer(layer_id, m_slicing_params.base_raft_layer_height, raft_print_z, raft_slice_z);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Layer *layer : m_object->layers()) {
|
for (Layer *layer : m_object->layers()) {
|
||||||
|
@ -1885,8 +1891,6 @@ void TreeSupport::generate()
|
||||||
detect_overhangs();
|
detect_overhangs();
|
||||||
profiler.stage_finish(STAGE_DETECT_OVERHANGS);
|
profiler.stage_finish(STAGE_DETECT_OVERHANGS);
|
||||||
|
|
||||||
if (!has_overhangs) return;
|
|
||||||
|
|
||||||
m_ts_data = m_object->alloc_tree_support_preview_cache();
|
m_ts_data = m_object->alloc_tree_support_preview_cache();
|
||||||
m_ts_data->is_slim = is_slim;
|
m_ts_data->is_slim = is_slim;
|
||||||
|
|
||||||
|
@ -1915,10 +1919,8 @@ void TreeSupport::generate()
|
||||||
draw_circles(contact_nodes);
|
draw_circles(contact_nodes);
|
||||||
profiler.stage_finish(STAGE_DRAW_CIRCLES);
|
profiler.stage_finish(STAGE_DRAW_CIRCLES);
|
||||||
|
|
||||||
for (auto& layer : contact_nodes)
|
for (auto& layer : contact_nodes) {
|
||||||
{
|
for (Node* p_node : layer) {
|
||||||
for (Node* p_node : layer)
|
|
||||||
{
|
|
||||||
delete p_node;
|
delete p_node;
|
||||||
}
|
}
|
||||||
layer.clear();
|
layer.clear();
|
||||||
|
|
Loading…
Reference in New Issue