refactor(display): trim isolines follow-up comments

This commit is contained in:
Hakan Seven committed 2026-09-10 18:05:42 +03:00
1 parent a202a61ffe
commit 5ffbf598a9
6 files changed
+8 -91

No files matched your search

+1 -12
View File
@@ -356,13 +356,6 @@ impl OpenCADStudio {
}
/// Write a header variable on the active drawing and mark it modified.
///
/// Deliberately does no geometry work. The variables the Options pages
/// write differ in what they cost to apply, and treating them alike is
/// wrong in both directions: `DISPSILH` is read at render time and needs
/// nothing, `SURFU`/`SURFV`/`SURFTYPE` are inputs to PEDIT's smoothing and
/// need nothing until it runs, while `ISOLINES` is baked into solid meshes
/// at tessellation and needs more than a bump — see `regenerate_meshes`.
pub(in crate::app) fn set_drawing_var(
&mut self,
write: impl FnOnce(&mut acadrust::document::HeaderVariables),
@@ -374,11 +367,7 @@ impl OpenCADStudio {
}
}
/// Re-tessellate the active drawing's solids from the document.
///
/// What REGEN does, and the only thing that makes a changed `ISOLINES`
/// reach solids that already exist. Costly on a solid-heavy drawing, so
/// callers driven by a slider run it when the drag ends, not per tick.
/// Re-tessellate active-drawing solids after an ISOLINES change.
pub(in crate::app) fn regenerate_meshes(&mut self) {
let i = self.active_tab;
if let Some(tab) = self.tabs.get_mut(i) {
+1 -15
View File
@@ -6305,15 +6305,7 @@ impl OpenCADStudio {
Task::none()
}
// Drawing variables: they go into the header of the active
// drawing and mark it modified, as SETVAR does. What each one
// costs to apply differs, so they are not treated alike.
//
// ISOLINES is baked into a solid's mesh when it is tessellated, so
// an existing solid keeps the density it was born with until the
// meshes are rebuilt. That is expensive, and a slider emits on
// every pixel of a drag, so the rebuild waits for the release —
// and only happens if the value actually moved.
// ISOLINES is baked into solid meshes, so rebuild once on release.
Message::IsolinesChanged(value) => {
let value = value.max(0);
let changed = self
@@ -6334,14 +6326,11 @@ impl OpenCADStudio {
Task::none()
}
// Read at render time, so nothing has to be rebuilt for it.
Message::DispSilhChanged(on) => {
self.set_drawing_var(|header| header.display_silhouette = on);
Task::none()
}
// Inputs to PEDIT's mesh smoothing; they change nothing until it
// runs, so writing the header is the whole job.
Message::SurfaceUChanged(value) => {
self.set_drawing_var(|header| header.surface_u_density = value.clamp(0, 200));
Task::none()
@@ -6357,14 +6346,11 @@ impl OpenCADStudio {
Task::none()
}
// Whether history is recorded from now on; nothing to redraw.
Message::SolidHistChanged(record) => {
self.set_drawing_var(|header| header.record_solid_history = record);
Task::none()
}
// Read while building geometry, so this one does bump — the same
// thing the SHOWHIST command does.
Message::ShowHistChanged(mode) => {
self.set_drawing_var(|header| {
header.show_solid_history = mode.clamp(0, 2)