forked from 1b-agent/opencadstudio-upstream
feat(view): add visual style previews
- preview render modes on hover without committing - distinguish 2D and 3D wireframe fill and depth behavior Refs #483
This commit is contained in:
1 parent
44d0c65ae9
commit
b1d55c6a7e
49 files changed
+560
-51
No files matched your search
@@ -108,12 +108,15 @@ impl Face3DGpu {
|
||||
/// true depth; fills with empty `fill_tris_low` (2D fills — text greek,
|
||||
/// MultiLeader / dimension backgrounds) feed the 2D draw-order buffer.
|
||||
/// - `keep_3d_mesh_fills`: when false (wireframe modes), the 3D side
|
||||
/// is left empty; the 2D side is always populated.
|
||||
/// is left empty.
|
||||
/// - `show_2d_solid_fills`: false only for Wireframe 3D; removes the
|
||||
/// legacy planar SOLID interior while keeping other 2-D overlays.
|
||||
pub fn from_wires(
|
||||
device: &wgpu::Device,
|
||||
face3d_wires: &[WireModel],
|
||||
all_wires: &[WireModel],
|
||||
keep_3d_mesh_fills: bool,
|
||||
show_2d_solid_fills: bool,
|
||||
depth_map: &rustc_hash::FxHashMap<u64, [f32; 2]>,
|
||||
) -> Self {
|
||||
let depth_of =
|
||||
@@ -168,13 +171,17 @@ impl Face3DGpu {
|
||||
// with both fill_tris and points (mesh edges + faces) keep the dim
|
||||
// so PolyfaceMesh / PolygonMesh still look 3-D-shaded.
|
||||
//
|
||||
// 2-D fills always go to `verts_2d` (visible in every mode).
|
||||
// 2-D fills go to `verts_2d`; only legacy planar SOLID interiors are
|
||||
// omitted by Wireframe 3D.
|
||||
// 3-D mesh face data goes to `verts_3d` only when
|
||||
// `keep_3d_mesh_fills` is true.
|
||||
for wire in all_wires {
|
||||
if wire.fill_tris.is_empty() {
|
||||
continue;
|
||||
}
|
||||
if !show_2d_solid_fills && wire.fill_is_2d_solid {
|
||||
continue;
|
||||
}
|
||||
// A real 3-D surface fill (PolyfaceMesh / PolygonMesh) carries a
|
||||
// double-single low residual paired with `fill_tris` — it lives at
|
||||
// true world coordinates and must keep its real depth. 2-D fills
|
||||
|
||||
Reference in new issue
Block a user