diff options
Diffstat (limited to 'xs/src/slic3r/GUI/3DScene.cpp')
-rw-r--r-- | xs/src/slic3r/GUI/3DScene.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/xs/src/slic3r/GUI/3DScene.cpp b/xs/src/slic3r/GUI/3DScene.cpp index 705347094..1901aa3a7 100644 --- a/xs/src/slic3r/GUI/3DScene.cpp +++ b/xs/src/slic3r/GUI/3DScene.cpp @@ -622,7 +622,7 @@ std::vector<int> GLVolumeCollection::load_object( const ModelVolume *model_volume = model_object->volumes[volume_idx]; int extruder_id = -1; - if (!model_volume->modifier) + if (model_volume->is_model_part()) { extruder_id = model_volume->config.has("extruder") ? model_volume->config.option("extruder")->getInt() : 0; if (extruder_id == 0) @@ -635,7 +635,16 @@ std::vector<int> GLVolumeCollection::load_object( volumes_idx.push_back(int(this->volumes.size())); float color[4]; memcpy(color, colors[((color_by == "volume") ? volume_idx : obj_idx) % 4], sizeof(float) * 3); - color[3] = model_volume->modifier ? 0.5f : 1.f; + if (model_volume->is_support_blocker()) { + color[0] = 1.0f; + color[1] = 0.2f; + color[2] = 0.2f; + } else if (model_volume->is_support_enforcer()) { + color[0] = 0.2f; + color[1] = 0.2f; + color[2] = 1.0f; + } + color[3] = model_volume->is_model_part() ? 1.f : 0.5f; this->volumes.emplace_back(new GLVolume(color)); GLVolume &v = *this->volumes.back(); if (use_VBOs) @@ -658,15 +667,15 @@ std::vector<int> GLVolumeCollection::load_object( else if (drag_by == "instance") v.drag_group_id = obj_idx * 1000 + instance_idx; - if (!model_volume->modifier) + if (model_volume->is_model_part()) { v.set_convex_hull(model_volume->get_convex_hull()); v.layer_height_texture = layer_height_texture; if (extruder_id != -1) v.extruder_id = extruder_id; } - v.is_modifier = model_volume->modifier; - v.shader_outside_printer_detection_enabled = !model_volume->modifier; + v.is_modifier = ! model_volume->is_model_part(); + v.shader_outside_printer_detection_enabled = model_volume->is_model_part(); v.set_origin(Pointf3(instance->offset.x, instance->offset.y, 0.0)); v.set_angle_z(instance->rotation); v.set_scale_factor(instance->scaling_factor); @@ -1182,7 +1191,7 @@ static void thick_lines_to_indexed_vertex_array( b1_prev = b1; v_prev = v; - if (bottom_z_different) + if (bottom_z_different && (closed || (!is_first && !is_last))) { // Found a change of the layer thickness -> Add a cap at the beginning of this segment. volume.push_quad(idx_a[BOTTOM], idx_a[RIGHT], idx_a[TOP], idx_a[LEFT]); @@ -1190,10 +1199,10 @@ static void thick_lines_to_indexed_vertex_array( if (! closed) { // Terminate open paths with caps. - if (is_first && !bottom_z_different) + if (is_first) volume.push_quad(idx_a[BOTTOM], idx_a[RIGHT], idx_a[TOP], idx_a[LEFT]); // We don't use 'else' because both cases are true if we have only one line. - if (is_last && !bottom_z_different) + if (is_last) volume.push_quad(idx_b[BOTTOM], idx_b[LEFT], idx_b[TOP], idx_b[RIGHT]); } |