feat(render): solid fill for PolyfaceMesh and PolygonMesh entities

PolyfaceMesh and PolygonMesh were wireframe-only. They now render with
the same flat-color solid fill as Face3D entities.

- Add fill_tris: Vec<[f32;3]> to TruckEntity and WireModel
- PolyfaceMesh: fan-triangulate each face into fill_tris
- PolygonMesh: triangulate each grid quad into fill_tris
- tessellate.rs Lines branch: apply world_offset to fill_tris
- Face3DGpu::from_wires: collect fill_tris from all wires in addition
  to Face3D key_vertices quads
- upload_face3d: pass all_wires so fill_tris are batched into one draw call
This commit is contained in:
Hakan Seven 2026-05-06 23:24:26 +03:00
commit 048bb41aef
61 changed files with 151 additions and 21 deletions

View file

@ -31,6 +31,7 @@ fn tessellate_polyline(pl: &Polyline) -> TruckEntity {
snap_pts: vec![],
tangent_geoms: vec![],
key_vertices: key_verts,
fill_tris: vec![],
}
}
@ -127,6 +128,7 @@ fn tessellate_polyline2d(pl: &Polyline2D) -> TruckEntity {
snap_pts: vec![],
tangent_geoms: vec![],
key_vertices: vec![],
fill_tris: vec![],
};
}
@ -204,7 +206,7 @@ fn tessellate_polyline2d(pl: &Polyline2D) -> TruckEntity {
if i + 1 < kv.len() { pts.push([f32::NAN; 3]); }
}
}
return TruckEntity { object: TruckObject::Lines(pts), snap_pts: vec![], tangent_geoms: tgs, key_vertices: kv };
return TruckEntity { object: TruckObject::Lines(pts), snap_pts: vec![], tangent_geoms: tgs, key_vertices: kv, fill_tris: vec![] };
}
for i in 0..seg_count {
@ -271,6 +273,7 @@ fn tessellate_polyline2d(pl: &Polyline2D) -> TruckEntity {
snap_pts: vec![],
tangent_geoms: tangents,
key_vertices: key_verts,
fill_tris: vec![],
}
}
@ -397,6 +400,7 @@ fn tessellate_polyline3d(pl: &Polyline3D) -> TruckEntity {
snap_pts: vec![],
tangent_geoms: vec![],
key_vertices: key_verts,
fill_tris: vec![],
}
}