forked from 1b-agent/opencadstudio-upstream
feat(render): wireframe modes hide mesh & 3D fills
Wireframe 2D/3D modlarında Solid3D meshlerini edge-only çizmek için LineList topolojili bir mesh wireframe pipeline ve her üçgenin (a,b),(b,c),(c,a) kenarlarına genişletilmiş ayrı bir index buffer eklendi. PolyfaceMesh / PolygonMesh face fill'leri (fill_tris + dolu points) wireframe'de gizleniyor; text greek / MultiLeader gibi 2D fill'ler (points boş) etkilenmiyor. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
2145ab8a66
commit
8dbdebeedc
4 files changed
+131
-12
No files matched your search
@@ -62,6 +62,7 @@ impl Face3DGpu {
|
||||
device: &wgpu::Device,
|
||||
face3d_wires: &[WireModel],
|
||||
all_wires: &[WireModel],
|
||||
keep_3d_mesh_fills: bool,
|
||||
) -> Self {
|
||||
let mut vertices: Vec<Face3DVertex> = Vec::with_capacity(face3d_wires.len() * 6);
|
||||
|
||||
@@ -91,10 +92,20 @@ impl Face3DGpu {
|
||||
// AO-style dim to them would wash out user-picked colors. Wires
|
||||
// with both fill_tris and points (mesh edges + faces) keep the dim
|
||||
// so PolyfaceMesh / PolygonMesh still look 3-D-shaded.
|
||||
//
|
||||
// When `keep_3d_mesh_fills` is false (wireframe render modes),
|
||||
// skip wires that carry 3-D mesh face data (`points` + `fill_tris`)
|
||||
// while leaving 2-D fills (text greek, MultiLeader background)
|
||||
// alone — they're not "3D objects" the wireframe toggle should
|
||||
// hide.
|
||||
for wire in all_wires {
|
||||
if wire.fill_tris.is_empty() {
|
||||
continue;
|
||||
}
|
||||
let is_3d_mesh_face = !wire.points.is_empty();
|
||||
if is_3d_mesh_face && !keep_3d_mesh_fills {
|
||||
continue;
|
||||
}
|
||||
let [r, g, b, a] = wire.color;
|
||||
let fill_color = if wire.points.is_empty() {
|
||||
[r, g, b, a]
|
||||
|
||||
Reference in new issue
Block a user