mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-06 11:47:58 -05:00
Work Out the Solid Model's Flat Face Cut-Off From Each Object's Layer Height and Walls
This commit is contained in:
1 parent
dac25fd5b0
commit
5131f4fc8e
7 files changed
+99
-32
No files matched your search
@@ -1131,12 +1131,13 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type,
|
||||
shader->set_uniform("uniform_color_clip_plane_1", m_color_clip_plane_colors[0]);
|
||||
shader->set_uniform("uniform_color_clip_plane_2", m_color_clip_plane_colors[1]);
|
||||
const unsigned int volume_id = volume.second.first;
|
||||
const bool flat_face_colors = volume_id < m_flat_face_colors.size() &&
|
||||
(m_flat_face_colors[volume_id][0].has_value() || m_flat_face_colors[volume_id][1].has_value());
|
||||
const FlatFaces* flat_faces = volume_id < m_flat_faces.size() ? &m_flat_faces[volume_id] : nullptr;
|
||||
const bool flat_face_colors = flat_faces != nullptr && (flat_faces->colors[0].has_value() || flat_faces->colors[1].has_value());
|
||||
shader->set_uniform("use_flat_face_colors", flat_face_colors);
|
||||
if (flat_face_colors) {
|
||||
shader->set_uniform("up_face_color", m_flat_face_colors[volume_id][0].value_or(volume.first->render_color));
|
||||
shader->set_uniform("down_face_color", m_flat_face_colors[volume_id][1].value_or(volume.first->render_color));
|
||||
shader->set_uniform("up_face_color", flat_faces->colors[0].value_or(volume.first->render_color));
|
||||
shader->set_uniform("down_face_color", flat_faces->colors[1].value_or(volume.first->render_color));
|
||||
shader->set_uniform("flat_face_normal_z", flat_faces->normal_z);
|
||||
}
|
||||
//BOOST_LOG_TRIVIAL(info) << boost::format("set uniform_color to {%1%, %2%, %3%, %4%}, with_outline=%5%, selected %6%")
|
||||
// %volume.first->render_color[0]%volume.first->render_color[1]%volume.first->render_color[2]%volume.first->render_color[3]
|
||||
|
||||
Reference in new issue
Block a user