mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-16 21:42:43 +00:00
Let the User Leave Out Infill or Everything But the Shell at Rest Too
A plate of large objects can be slow to draw even when nothing is moving, and the reductions built for dragging cannot help there because they skip layers. So a second choice, applied at all times, leaves out the internal infill roles or everything but the shell while drawing every layer. It is a third index buffer filled by the same walk as the other two and bound whenever the dragging set is not; the options need no counterpart since every layer is drawn. The shell classification is shared, computed once when either choice asks for it. On the 636-layer three-filament fixture at rest, against 448467 segments in 334 ms at full detail: internal infill left out 347208 segments 272 ms everything but the shell 215797 segments 181 ms With the shell at rest and the shell at one layer in four while dragging, the drag frame is 62 ms. At rest with the choice set to nothing, the preview is pixel identical to before.
This commit is contained in:
@@ -1176,6 +1176,7 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const
|
||||
m_reduced_detail_while_dragging = get_app_config()->get_bool("preview_reduced_detail_while_dragging");
|
||||
m_reduced_detail_mode = reduced_detail_mode_from_string(get_app_config()->get("preview_reduced_detail_mode"));
|
||||
m_reduced_detail_layer_stride = static_cast<unsigned int>(std::max(1, std::stoi(get_app_config()->get("preview_reduced_detail_layer_stride"))));
|
||||
m_rest_detail_mode = reduced_detail_mode_from_string(get_app_config()->get("preview_rest_detail_mode"));
|
||||
apply_reduced_detail_settings();
|
||||
|
||||
// ORCA: darken the layers the preview layer slider is not scrubbed to
|
||||
@@ -1924,6 +1925,13 @@ void GCodeViewer::apply_reduced_detail_settings()
|
||||
{
|
||||
m_viewer.set_reduced_detail_mode(m_reduced_detail_while_dragging ? m_reduced_detail_mode : libvgcode::EReducedDetailMode::Off);
|
||||
m_viewer.set_reduced_detail_layer_stride(m_reduced_detail_layer_stride);
|
||||
m_viewer.set_rest_detail_mode(m_rest_detail_mode);
|
||||
}
|
||||
|
||||
void GCodeViewer::set_rest_detail_mode(const std::string& mode)
|
||||
{
|
||||
m_rest_detail_mode = reduced_detail_mode_from_string(mode);
|
||||
apply_reduced_detail_settings();
|
||||
}
|
||||
|
||||
void GCodeViewer::set_reduced_detail_while_dragging(bool value)
|
||||
@@ -1946,6 +1954,8 @@ void GCodeViewer::set_reduced_detail_layer_stride(unsigned int value)
|
||||
|
||||
libvgcode::EReducedDetailMode GCodeViewer::reduced_detail_mode_from_string(const std::string& mode)
|
||||
{
|
||||
if (mode == "full")
|
||||
return libvgcode::EReducedDetailMode::Off;
|
||||
if (mode == "layers")
|
||||
return libvgcode::EReducedDetailMode::LayersOnly;
|
||||
if (mode == "shell")
|
||||
|
||||
Reference in New Issue
Block a user