forked from 1b-agent/opencadstudio-upstream
feat(lwpolyline): render the wide-polyline band via the wire shader
A wide polyline's flat band was drawn by the hatch pipeline: a solid fill with only draw-order depth. It ignored the entity linetype (the width "crushed" the dash pattern) and showed through 3-D geometry in a tilted view. Draw the band from the polyline's own centre-line wire instead. A new `WireModel.world_width` (drawing units) makes the wire vertex shader expand the quad by `world_half_width / world_per_pixel` (clamped to a hairline), so the band is sized in world units and tracks zoom. Because it is now a wire: - the GPU dash shader dashes the band by arc-length — the linetype applies; - it is depth-tested at the polyline elevation — no draw-order see-through; - no CPU band triangles or per-dash geometry are generated. `world_half_width` rides in `WireConst` (native, replacing a pad) and the web `WireInstance` (loc 14); both wire shaders branch on it. The tessellator sets `world_width` from the LwPolyline width on the Contour / SegmentedLines arms, and the model-space fill loop no longer emits a hatch band for any LwPolyline. Pick still uses the band polygon (`pick_tris`). Blocks keep the hatch band: `LocalWire` carries no `world_width` (finalize zeroes it), so a scaled insert still scales its band correctly. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
3d37e1f8d8
commit
bd1a5affd7
44 files changed
+158
-17
No files matched your search
@@ -1352,6 +1352,7 @@ fn tessellate_dimension_inner(
|
||||
let (ext1, ext2) = split_ext_lines(&geom.ext_lines);
|
||||
if !ext1.is_empty() {
|
||||
wires.push(WireModel {
|
||||
world_width: 0.0,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
@@ -1378,6 +1379,7 @@ fn tessellate_dimension_inner(
|
||||
}
|
||||
if !ext2.is_empty() {
|
||||
wires.push(WireModel {
|
||||
world_width: 0.0,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
@@ -1404,6 +1406,7 @@ fn tessellate_dimension_inner(
|
||||
}
|
||||
} else {
|
||||
wires.push(WireModel {
|
||||
world_width: 0.0,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
@@ -1431,6 +1434,7 @@ fn tessellate_dimension_inner(
|
||||
}
|
||||
|
||||
wires.push(WireModel {
|
||||
world_width: 0.0,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
@@ -1474,6 +1478,7 @@ fn tessellate_dimension_inner(
|
||||
aci_to_rgba(&c)
|
||||
};
|
||||
wires.push(WireModel {
|
||||
world_width: 0.0,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
|
||||
@@ -590,6 +590,7 @@ impl LeaderTess for Leader {
|
||||
|
||||
if verts.len() < 2 {
|
||||
return WireModel {
|
||||
world_width: 0.0,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
@@ -696,6 +697,7 @@ impl LeaderTess for Leader {
|
||||
}
|
||||
|
||||
WireModel {
|
||||
world_width: 0.0,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
|
||||
@@ -1404,6 +1404,7 @@ impl MultiLeaderTess for MultiLeader {
|
||||
// WireModels so the renderer respects per-piece coloring.
|
||||
let mut wires: Vec<WireModel> = Vec::new();
|
||||
wires.push(WireModel {
|
||||
world_width: 0.0,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
@@ -1693,6 +1694,7 @@ impl MultiLeaderTess for MultiLeader {
|
||||
xy = xy.max(y);
|
||||
}
|
||||
wires.push(WireModel {
|
||||
world_width: 0.0,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
@@ -1760,6 +1762,7 @@ impl MultiLeaderTess for MultiLeader {
|
||||
wcs_corners[3],
|
||||
];
|
||||
wires.push(WireModel {
|
||||
world_width: 0.0,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
@@ -1795,6 +1798,7 @@ impl MultiLeaderTess for MultiLeader {
|
||||
wcs_corners[0],
|
||||
];
|
||||
wires.push(WireModel {
|
||||
world_width: 0.0,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
|
||||
@@ -753,6 +753,7 @@ pub fn tessellate_table(
|
||||
let mk =
|
||||
|color: [f32; 4], points: Vec<[f32; 3]>, fill_tris: Vec<[f32; 3]>, lw: f32| -> WireModel {
|
||||
WireModel {
|
||||
world_width: 0.0,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
|
||||
Reference in new issue
Block a user