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 <noreply@anthropic.com>
This commit is contained in:
parent
626e8091f7
commit
3d37e1f8d8
5 changed files with 124 additions and 3 deletions
|
|
@ -211,7 +211,18 @@ impl Face3DGpu {
|
|||
}
|
||||
} else {
|
||||
let fill_color = [r, g, b, a];
|
||||
let depth = depth_of(wire);
|
||||
// A fill whose triangles span depth is a genuine 3-D surface (an
|
||||
// extruded polyline tube), not a flat coplanar overlay (2-D SOLID,
|
||||
// greek text, dimension background). Keep its real depth so the
|
||||
// fill occludes correctly and its own edge wires — coincident with
|
||||
// the surface — win the depth test and stay visible. A flat overlay
|
||||
// keeps the draw-order bias that layers it in screen order.
|
||||
let (mut zmin, mut zmax) = (f32::INFINITY, f32::NEG_INFINITY);
|
||||
for p in &wire.fill_tris {
|
||||
zmin = zmin.min(p[2]);
|
||||
zmax = zmax.max(p[2]);
|
||||
}
|
||||
let depth = if zmax - zmin > 1e-4 { 0.0 } else { depth_of(wire) };
|
||||
for (i, &position) in wire.fill_tris.iter().enumerate() {
|
||||
verts_2d.push(Face3DVertex {
|
||||
position,
|
||||
|
|
|
|||
Loading…
Reference in a new issue