forked from 1b-agent/opencadstudio-upstream
feat(render): draw ACIS solids as B-rep feature edges, meshes as tri edges
Solid wireframes rendered every triangle edge of the tessellation, so a curved solid read as a dense mesh instead of its real outline. Now each ACIS solid's B-rep face-boundary edges are collected from the SAT `edge` records (straight edges as segments, ellipse/circle edges sampled along their bounded arc), body-transformed and split into the double-single pair, and stored on the MeshLodSet. The block-instance and top-level offset paths transform these edges alongside the mesh vertices. The batch builder routes a solid with feature edges into a dedicated LineList vertex buffer and skips its triangle wireframe; a mesh with no B-rep edges keeps its triangulation edges. Edge colour follows the display mode: the flat `fs_edge` shader draws the entity colour in the lines-only modes (wireframe, hidden-line) and a `fs_edge_black` twin forces black for the edge overlay in filled render modes. Verified: the Clinic storefront arch bars now yield ~14-16 clean edge segments (vs the full triangulation) bounded to the solid's true extent. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
a08cf477c1
commit
1065bc12b2
6 files changed
+285
-63
No files matched your search
@@ -79,3 +79,17 @@ fn fs_main(in: VertexOut) -> @location(0) vec4<f32> {
|
||||
let rgb = in.color.rgb * clamp(diff, 0.0, 1.0);
|
||||
return vec4<f32>(rgb, in.color.a);
|
||||
}
|
||||
|
||||
// Edge fragment (LineList): flat entity colour, no lighting. Used for the
|
||||
// wireframe and hidden-line edge passes so lines read at their true colour.
|
||||
@fragment
|
||||
fn fs_edge(in: VertexOut) -> @location(0) vec4<f32> {
|
||||
return vec4<f32>(in.color.rgb, 1.0);
|
||||
}
|
||||
|
||||
// Edge fragment for filled render modes: force black so edges frame the shaded
|
||||
// fill regardless of the solid's colour.
|
||||
@fragment
|
||||
fn fs_edge_black(in: VertexOut) -> @location(0) vec4<f32> {
|
||||
return vec4<f32>(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
Reference in new issue
Block a user