fix(polyline): correct wide-polyline fill band arc center + add LWDISPLAY toggle

Wide LWPolyline/Polyline2D fill bands now sit on the centerline:
- polyline_segment_fill arc center matched explode.rs / acadrust convention
  (signed d_perp = r·(1-b²)/(1+b²), handles major arcs correctly)
- per-vertex hw0/hw1 taper applied along arc; tess density 24/circle
- synced_hatch_models subtracts hatch_offset from band boundary so it lives
  in the same offset-rel space as the wire tessellation

LWDISPLAY:
- new command `LWDISPLAY [ON|OFF]` toggles header.lineweight_display
- LWT status-bar pill (between ORTHO and POLAR) drives the same flag
- bump_geometry() on change so the viewport re-tess immediately

Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.7 committed 2026-05-23 07:15:26 +03:00
1 parent 2790182067
commit fb3dd58d09
6 files changed
+91 -21

No files matched your search

+32
View File
@@ -4506,6 +4506,38 @@ impl H7CAD {
self.command_line.push_error("Usage: LTSCALE [value]");
}
}
cmd if cmd == "LWDISPLAY" || cmd.starts_with("LWDISPLAY ") => {
let val_str = cmd.trim_start_matches("LWDISPLAY").trim();
let parsed: Result<Option<bool>, ()> =
match val_str.to_ascii_uppercase().as_str() {
"" => Ok(None),
"ON" | "1" | "TRUE" => Ok(Some(true)),
"OFF" | "0" | "FALSE" => Ok(Some(false)),
_ => Err(()),
};
match parsed {
Err(_) => self
.command_line
.push_error("Usage: LWDISPLAY [ON|OFF]"),
Ok(Some(v)) => {
self.push_undo_snapshot(i, "LWDISPLAY");
self.tabs[i].scene.document.header.lineweight_display = v;
self.tabs[i].scene.bump_geometry();
self.tabs[i].dirty = true;
self.command_line.push_output(&format!(
"LWDISPLAY {}",
if v { "ON" } else { "OFF" }
));
}
Ok(None) => {
let v = self.tabs[i].scene.document.header.lineweight_display;
self.command_line.push_output(&format!(
"LWDISPLAY = {}",
if v { "ON" } else { "OFF" }
));
}
}
}
cmd if cmd == "CELTSCALE" || cmd.starts_with("CELTSCALE ") => {
let val_str = cmd.trim_start_matches("CELTSCALE").trim();
if val_str.is_empty() {
+2
View File
@@ -401,6 +401,8 @@ pub enum Message {
ToggleGrid,
/// Toggle orthogonal drawing constraint — F8 / ORTHO status-bar button.
ToggleOrtho,
/// Toggle LWDISPLAY header flag — LWT status-bar button.
ToggleLineweightDisplay,
/// Toggle polar-angle constraint — F10 / POLAR status-bar button.
TogglePolar,
/// Set polar tracking angle increment (right-click POLAR button).
+10
View File
@@ -2509,6 +2509,16 @@ impl H7CAD {
}
Task::none()
}
Message::ToggleLineweightDisplay => {
let i = self.active_tab;
if i < self.tabs.len() {
let h = &mut self.tabs[i].scene.document.header;
h.lineweight_display = !h.lineweight_display;
self.tabs[i].scene.bump_geometry();
self.tabs[i].dirty = true;
}
Task::none()
}
Message::TogglePolar => {
self.polar_mode ^= true;
if self.polar_mode {
+1
View File
@@ -544,6 +544,7 @@ impl H7CAD {
tab.scene.annotation_scale,
self.scale_popup_open,
scale_pill_enabled,
tab.scene.document.header.lineweight_display,
)
})
.width(Fill)