forked from 1b-agent/opencadstudio-upstream
feat(solid3d): draw ISOLINES on curved faces in wireframe
A cylinder's wireframe showed only its two rim circles, so from the side it read as two disconnected ellipses rather than a cylinder. AutoCAD draws ISOLINES — a fixed set of longitudinal lines on each curved face — so the surface reads from any angle. `collect_isolines` walks the cone-surface faces (cylinder and cone), recovers each face's height and angular extent with the same logic `tess_cone_face` uses, and emits `header.isolines` (default 4) longitudinal segments from the bottom rim to the top rim. They are appended to the feature-edge line list, so they ride the existing body transform, double-single split, and top-level / per-INSTANCE re-split for free. Being part of `edge_verts`, they inherit the edge pass's gating: drawn in the wireframe modes and in shaded-with-edges, hidden in plain shaded — matching where AutoCAD shows isolines. `isolines` is threaded from the header through the tessellation entry points alongside `facet_res`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
26e83a90bf
commit
0ce150411a
4 files changed
+115
-22
No files matched your search
+2
-1
@@ -341,6 +341,7 @@ pub fn build_derived_caches(doc: &CadDocument) -> DerivedCaches {
|
||||
// Top-level (layout-owned) solids are offset into the render frame; block
|
||||
// definition solids keep block-local coords for per-INSERT instancing. (#123)
|
||||
let facet_res = doc.header.facet_resolution;
|
||||
let isolines = doc.header.isolines.max(0) as usize;
|
||||
// Real layout blocks come from the Layout objects' block_record handles —
|
||||
// `BlockRecord::is_layout()` is unreliable here (it flags ordinary blocks).
|
||||
let layout_blocks: std::collections::HashSet<Handle> = doc
|
||||
@@ -360,7 +361,7 @@ pub fn build_derived_caches(doc: &CadDocument) -> DerivedCaches {
|
||||
let (raw, ..) = view::render::render_style_for(doc, e);
|
||||
let color = view::render::adapt_to_bg(raw, LOAD_BG);
|
||||
let top_level = layout_blocks.contains(&e.common().owner_handle);
|
||||
crate::entities::solid3d::tessellate_volume(e, color, facet_res).map(|m| {
|
||||
crate::entities::solid3d::tessellate_volume(e, color, facet_res, isolines).map(|m| {
|
||||
let m = if top_level { offset_mesh_lod_set(m) } else { m };
|
||||
(handle, m, top_level)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user