fix(render): flag 2D overlay fills so they show in every view mode

A SOLID's filled quad and a dimension/MultiLeader text background are flat 2-D
overlays that should draw in wireframe and shaded alike, but face3d_gpu
classified fills by `!fill_tris_low.is_empty()` — and a 2-D fill at UTM scale
carries a double-single low residual for precision just like a real 3-D mesh
face. So the arrowhead fill and the "5;8" cyan text background were routed to
the 3-D buffer and only appeared in shaded mode, vanishing back to nothing on
return to wireframe.

WireModel now carries an explicit `fill_is_3d`: true only for a real surface
(PolyfaceMesh / PolygonMesh face, set in the tessellator), false for every flat
overlay fill. face3d_gpu classifies on the flag, so 2-D fills stay in the
always-visible buffer while keeping their low residual (and UTM precision).

Verified on budweiser: the `_BoxFilled` arrow SOLID and the dim '5;8' MTEXT
background both tessellate with fill_is_3d = false.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-18 15:15:24 +03:00
1 parent 015973babb
commit 50f6196594
41 files changed
+94 -6

No files matched your search

+2
View File
@@ -186,6 +186,7 @@ impl CadCommand for AlignedDimensionCommand {
let p1 = p1.as_vec3();
let p2 = p2.as_vec3();
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
@@ -237,6 +238,7 @@ fn preview_aligned(p1: DVec3, p2: DVec3, dim_pt: DVec3) -> WireModel {
let d1 = d1.as_vec3();
let d2 = d2.as_vec3();
WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -130,6 +130,7 @@ fn v3(pt: DVec3) -> Vector3 {
fn preview_wire(points: Vec<Vec3>) -> WireModel {
WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -180,6 +180,7 @@ fn v3(p: DVec3) -> Vector3 {
fn preview_line(a: Vec3, b: Vec3) -> WireModel {
WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -179,6 +179,7 @@ impl CadCommand for DimBaselineCommand {
let dim_line_pt2 = dim_line_pt2.as_vec3();
let pt = pt.as_vec3();
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -159,6 +159,7 @@ impl CadCommand for DimContinueCommand {
let dim_line_pt = p1 + perp * (dim_line_perp - p1.dot(perp));
let dim_line_pt2 = pt + perp * (dim_line_perp - pt.dot(perp));
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -85,6 +85,7 @@ impl CadCommand for DimJogLineCommand {
}
let d = 0.3_f32;
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -100,6 +100,7 @@ impl CadCommand for DimTeditCommand {
}
let d = 0.2_f32;
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -163,6 +163,7 @@ fn preview_wire(pts: &[Vec3]) -> WireModel {
points.push([w2.x, w2.y, w2.z]);
}
WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -218,6 +218,7 @@ fn v3(pt: DVec3) -> Vector3 {
fn preview_wire(points: Vec<DVec3>) -> WireModel {
WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -150,6 +150,7 @@ fn preview_wire(pts: &[Vec3]) -> WireModel {
points.push([w2.x, w2.y, w2.z]);
}
WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -458,6 +458,7 @@ impl CadCommand for MLeaderCollectCommand {
fn preview_wire(pts: &[Vec3]) -> WireModel {
WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -121,6 +121,7 @@ fn ordinate_elbow(feature: DVec3, leader: DVec3, is_x: bool) -> DVec3 {
fn preview_wire(points: Vec<Vec3>) -> WireModel {
WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -90,6 +90,7 @@ impl CadCommand for QdimCommand {
}
let d = 0.5_f32;
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -185,6 +185,7 @@ fn v3(pt: DVec3) -> Vector3 {
fn preview_wire(points: Vec<Vec3>) -> WireModel {
WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -139,6 +139,7 @@ impl CadCommand for TableCommand {
let y = pt.y;
let z = pt.z;
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -84,6 +84,7 @@ impl CadCommand for ToleranceCommand {
}
let d = 0.15_f32;
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -160,6 +160,7 @@ impl CadCommand for AttdefCommand {
// Show a small cross at the insertion point.
let d = 0.15_f32;
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -136,6 +136,7 @@ impl CadCommand for MlineCommand {
.collect();
pts.push([pt.x, pt.y, pt.z]);
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -108,6 +108,7 @@ impl CadCommand for ImageCommand {
let p3 = [origin.x, origin.y + world_height, origin.z];
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+2
View File
@@ -84,6 +84,7 @@ impl CadCommand for RayCommand {
let dir = (pt - base).normalize_or_zero();
let far = base + dir * DISPLAY_EXTENT;
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
@@ -179,6 +180,7 @@ impl CadCommand for XLineCommand {
let far_pos = base + dir * DISPLAY_EXTENT;
let far_neg = base - dir * DISPLAY_EXTENT;
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -89,6 +89,7 @@ impl CadCommand for RevCloudCommand {
self.points[0].z as f32,
]);
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+2
View File
@@ -114,6 +114,7 @@ impl CadCommand for WipeoutCommand {
let min = p1.min(pt);
let max = p1.max(pt);
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
@@ -160,6 +161,7 @@ impl CadCommand for WipeoutCommand {
self.poly_pts[0].z as f32,
]);
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -69,6 +69,7 @@ impl CadCommand for AreaCommand {
pts.push(f(pt));
pts.push(f(self.points[0]));
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -63,6 +63,7 @@ impl CadCommand for DistCommand {
let p1 = self.first?;
// The preview wire is purely visual, so f32 vertices are fine here.
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -67,6 +67,7 @@ impl MeasureGeomCommand {
/// Build a cyan preview wire connecting the picked points and the cursor.
fn preview_wire(name: &str, pts: Vec<[f32; 3]>) -> WireModel {
WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -3059,6 +3059,7 @@ fn collect_runs(pts: &[[f64; 2]], take: &dyn Fn([f64; 2]) -> bool, out: &mut Vec
/// Build a preview wire from a NaN-break point list.
fn preview_wire(points: Vec<[f32; 3]>, color: [f32; 4], name: &str) -> WireModel {
WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -81,6 +81,7 @@ impl CadCommand for MviewCommand {
let pt = pt.as_vec3();
let c1 = self.corner1?;
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -305,6 +305,7 @@ inventory::submit!(crate::command::CommandRegistration {
fn wire(name: &str, points: Vec<[f32; 3]>) -> WireModel {
WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -48,6 +48,7 @@ impl CadCommand for PlotWindowCommand {
let p1 = self.p1?.as_vec3();
// Draw the selection rectangle.
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -65,6 +65,7 @@ impl CadCommand for ZoomWindowCommand {
let max = p1.max(pt);
// Draw a rectangle preview
Some(WireModel {
fill_is_3d: false,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,