Repository navigation
fix(saved-mesh): mesh a cylinder face trimmed by more than two loops - #2248
oguzhanakk wants to merge 2 commits into
Conversation
The two-loop path's strip mesher (band_mesh, even-odd across U) takes any number of rings; the loops share the face's point budget. A full turn with several loops stays refused.
|
@oguzhanakk @DrunkOnJava I replayed this head at The guard also catches a separate synthetic case. On a partial cylinder of radius 2, use a UV outer rectangle from There's also a seam check worth keeping separate from ring admission. The replay has 57 distinct solid carriers across those 17 doors. This head closes 40 across the three weld sizes and eight grid phases I tested. Giving both adjacent faces the same ordered trim subdivisions closes 57/57 and removes the one-sided edges on every grid. That comparison is against the saved reader geometry. I have yet to find a matching Revit export for this Autodesk sample. Would you prefer the synthetic crossing-ring guard as a small follow-up to this PR, with shared-edge conformity reviewed separately? I can provide the generated graph and the public replay harness. |
…union band_mesh fills between a strip's crossings by the even-odd rule, so two cutouts that overlap left the part they share filled (shifatrHtH's rings on DrunkOnJava#2248: 3.84 where the outer ring less the cutouts' union is 3.63). Rings that cross are now found first, at both sides of every strip, where the spans are exact: those one ring encloses together are drawn as their union, and a crossing with no ring round it (a cutout across the outer boundary, pieces that overlap) or one between two knots is refused. Faces whose rings do not cross are meshed as before. Three failure-mode tests of the pure helper (the reviewer's rings, a crossing no single strip shows, the refusals) raise the file's count to 64.
|
@shifatrHtH thank you for the replay and for the crossing-ring case. It's a real bug in this PR, so I've fixed it here rather than in a follow-up. Pushed 9dbe86e. Your rings are now a unit test: 3.63, and 4.23 with the second cutout moved clear (my own control, not necessarily the one you used). Two more tests cover the failure modes: the crossing no strip shows, and the refusals. Under the pure-helper rule that raises the file's count from 61 to 64, so it needs the second maintainer review. On the public Revit 2026 MEP Basic sample, the 17 doors still decode, and the IFC is byte-identical to the previous head, so their meshes are unchanged. The 11 Autodesk RAC/RST samples show no change against the previous head. Shared-edge conformity: agreed, let's review it separately. 57/57 closed with the same ordered trim subdivisions on both faces is a strong result. I'd welcome the generated graph and the replay harness for that follow-up. |
|
@oguzhanakk I independently replayed I agree with keeping shared-edge conformity in a separate review. The 57/57 closed-carrier result is from the earlier opt-in seam trial. I'll use |
Keep the crossing-ring mesher from DrunkOnJava#2248 and add a scoped conforming retry for plane and cylinder carriers. The retry commits only closed oriented triangle sets. Include a generated graph and a replay for the public Revit 2026 Basic MEP doors.
|
@oguzhanakk The separate shared-edge follow-up is ready to replay from the exact On Autodesk's public Revit 2026 Basic MEP sample, the disabled arm matches the unmodified head on all 17 doors. The candidate closes 57/57 source carriers at all 24 weld grids, up from 40/57, with zero one-sided edges, nonmanifold edges, or winding conflicts per carrier. The enabled vertex, index and ledger buffers reproduce byte for byte. The candidate is within 0.000562 ft of the disabled arm in both sampled directions. That delta compares two reader outputs. A same-save Fine Revit capture is still needed for the independent surface check. The generated graph closes four planes and two cylinder patches with opposed edge incidence and refuses a displaced stored sample. The union and separate-cutout controls still measure 3.63 and 4.23 UV area. The candidate stays opt-in, and the signed branch is available for review without adding another PR to the queue before #2248 lands. |
Summary
A cylinder face trimmed by more than two loops is meshed by the path two loops already take: the loops share the face's point budget (
CYLINDER_RING_POINT_BUDGET / n) andband_meshmeshes them strip by strip across U with its even-odd rule. A full turn with several loops stays refused. Such a face was refused asmultiple cylinder trim loops unsupported.Motivation
RE-407 lists cylinder faces with an outer ring and two or more holes, or three outer rings, as a large reason elements stay record boxes (on Autodesk's 2024 samples, 26 + 3 + 2 of the 175 several-loop faces). Two loops are meshed today by
band_mesh, which reads any number of rings: each strip collects every ring edge that spans it, sorts the crossings and fills between pairs, refusing an odd count. Nothing in it is specific to two.RE-407 tested a different mesher (earcut per outer ring in arc-length coordinates, cut into strips) and did not ship it: 30 furniture of the BIM4LCA office read 1.11 times Revit's volume (the record box: 16 times), which it could not explain by the loops. This change adds no new tessellation; it lets more faces reach the strips the two-loop faces are already drawn with. Whether those 30 read differently with it I could not check (no BIM4LCA run here), and that is the check I would ask Measure for before it lands.
Changes
src/research/native_saved_mesh.rs,cylinder_face_with_shared_edges: every loop of the face is read (cycle-checked), each withCYLINDER_RING_POINT_BUDGET / npoints; the budget, not a count of loops, bounds the work, and a loop given too few points is refused with the budget's own error.ring_gaps(the Family instances that stay boxes: expose symbol geometry and instance placement #2085 probe helper) splits the budget the same way.changelog.d/fixed/cylinder-several-trim-loops.md.Testing
Three pure-helper failure-mode unit tests next to the existing #2106
band_meshtests (added in 9dbe86e after review): overlapping cutouts cut as their union (the reviewer's rings, 3.63), a crossing no single strip shows, and the two refusals.tools/ci/unit-test-counts.txtfor this file goes from 61 to 64, so this needs the second maintainer review.cargo fmt --checkandtools/release/changelog.py checkpass;cargo clippy --release --lib(Rust 1.100) finds nothing in the changed code (its one finding,enum_variant_namesinpartition_name_candidates.rs, is onmaintoo).mainat a79664d against this branch: onrac_advanced(2024, 2026, 2027 alike) 7 elements move from record boxes to saved meshes (partition_element_record_bbox216 -> 209,saved_graphics_mesh+7) andmultiple cylinder trim loops unsupportedgoes from 7 to 0; nothing else changes on any sample; time and peak RSS within noise.Audit-honesty checklist
Breaking changes
None in the API. IFC output changes for the elements above.
Legal and contribution hygiene
Related: #2243 (the same contributor's saved-mesh change for hollow framing and overrunning walls). This pull request is independent of it and applies to
mainon its own.