fix(thickness): edit persists + wide polyline extrudes as a solid tube

Entering a thickness (DXF 39 extrusion) on a wide polyline now works end
to end:

- The properties Thickness field is a General-group common prop, so it is
  routed to apply_common_prop (set_entity_thickness) instead of the
  geometry setter, which ignored it — the value was silently dropped and
  reverted to 0.
- A wide polyline extrudes its whole band into a 3-D tube (outer + inner
  walls with top and bottom caps), not just its centreline.
- The tube is real 3-D geometry, not a flat draw-order hatch: it renders
  solid in every view mode with true depth, so nothing shows through the
  walls. The flat 2-D band fill is skipped for a thickened polyline.
- A fill whose triangles span depth keeps its real depth (no draw-order
  bias), so the extrusion's own edge wires stay in front of the surface
  and remain visible instead of only the silhouette.
- The corner and cap edge lines read black, framing the coloured tube.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-20 13:40:12 +03:00
1 parent 626e8091f7
commit 3d37e1f8d8
5 files changed
+124 -3

No files matched your search

+13 -1
View File
@@ -1116,6 +1116,18 @@ pub fn tessellate(
let mut out = Vec::new();
let mut is_first = true;
// A thickened wide polyline's extrusion — its corner / cap edges
// frame the solid tube and read black (like solid-with-edges
// outlines), while the tube fill keeps the entity colour.
let edge_color = if matches!(
entity,
EntityType::LwPolyline(p) if p.thickness.abs() > 1e-10
) {
[0.0, 0.0, 0.0, 1.0]
} else {
color
};
if !local_pts.is_empty() {
let (snap, keys, tangents) = if is_first {
is_first = false;
@@ -1137,7 +1149,7 @@ pub fn tessellate(
name: name.clone(),
points: local_pts,
points_low: local_pts_low,
color,
color: edge_color,
selected,
pattern_length: 0.0,
pattern: [0.0; 8],