Skip to content

fix(saved-graphics): mesh a cylinder face trimmed by any single loop, in strips across its angle (#1247) (RE-304) - #1257

Merged
DrunkOnJava merged 5 commits into
mainfrom
research/1247-cylinder-trims
Nov 3, 2026
Merged

DrunkOnJava merged 5 commits into
mainfrom
research/1247-cylinder-trims

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Saved meshes read a cylinder face whose trim loop does not run round its UV box: a door's curved faces cut by its leaf and frame, a fitting's. Before, such a face was rejected and the whole element kept its box (RE-224). A cylinder is straight along its axis, so only U needs the chord bound. The loop is clipped into strips across U at the grid's own U values and earcut in arc-length coordinates. The strips must cover the loop's own area, or it is rejected as self-intersecting. A loop that does run round its box keeps the grid it had (RE-304).

Motivation

#1247. After RE-300 and RE-301, nonrectangular cylinder trim was the largest remaining reason a saved mesh is kept as a box: 718 elements in the census, 451 for that alone (Measure 41555808867). n3ur0m4n had offered this part in #1144. They were told on #1144 that we picked it up (with the maintainer's approval); cone faces and spline profiles stay theirs.

Changes

  • src/research/native_saved_mesh.rs, cylinder_face:
    • envelope and repeated-vertex checks stay errors;
    • a rectangular loop keeps the grid;
    • any other single loop goes to strip_mesh (with clip_u, Sutherland–Hodgman against one U line).
    • Faces with several loops are still rejected.
  • reports/element-framing/RE-304-cylinder-trims.md, the reconnaissance addendum, and changelog.d/fixed/1247-cylinder-trims.md.

Testing

Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead.

  • tools/check-local.sh: CI.
  • Verified end to end on real Revit files. Measure 41563982575 (1b983f8 against main at 3e0ad51, --saved-meshes):
    • Office as built: 10,924 → 11,079 bodies drawn from saved meshes, 279 → 124 boxes. Scored against Revit's export 1,495 → 1,650; exact to 0.001 ft 1,403 → 1,554; within 0.01 ft 1,481 → 1,636; volume within 1% 1,477 → 1,632. Every new body is a door: 151 exact, all within 0.01 ft and 1%. At permit the same, +155.
    • RE1 Architecture: a toilet, within 0.0126 ft.
    • RE1 Plumbing: 11 more fittings with the profile of the 35 already drawn (RE-78).
    • Core Interior, RE1 Electrical and Mechanical unchanged.
    • Size: office 473,681 → 568,965 triangles.
  • Measure 41567035509 (055e513 against main at 957dada, default flags, unfiltered, with the office, R2025, held-out models and samples). 17 of 103 exports move, every change an improvement in the doors the default export draws from saved meshes:
    • Office: +155 doors. box_bodies_vs_ifc loses 155 boxes, and door_bodies_vs_ifc's "mirror rule wrong" goes from 155 to 0. mesh_bodies_vs_ifc IfcDoor 114 → 269 scored, 265 exact.
    • R2025 rooms models 12 to 17: one door each, 0 → 1 of 4, within 0.0085 ft of Revit's body at 1.0002 of its volume.
    • rme samples 2024 to 2027: 0 → 107 of 124. Snowdon Towers architectural: 118 → 130. Both counted, not scored.
    • Properties, quantities, openings and the held-out counts are unchanged.
  • Measure 41568813620: the final head (3913319, with the strip budget guard, the report's corrections and main merged in) against the measured head 1b983f8, --saved-meshes. All 17 exports byte-identical and the scorer diff empty, so the guard never fires.
  • Review (Sonnet 5.5 xhigh, automated Claude Code review): no blocking code findings.
  • Cost: about 615 triangles per new door; the office's --saved-meshes IFC goes from 76.6 to 82.1 MB, and its export from 33.8 s to 37.7 s.

Audit-honesty checklist

  • README / docs reflect the current state after this PR
  • A user-visible change has its entry as a fragment under changelog.d/
  • Commit messages describe what changed and why
  • No emojis in code, docs, or commit messages
  • No private paths, personal email addresses, or internal jargon in committed files
  • Reverse-engineering finding: report with measured counts against Revit's own export, reconnaissance addendum

Legal and contribution hygiene

  • Apache-2.0
  • No Autodesk proprietary content
  • No fixtures

Contributor declaration (CLEANROOM.md): based on the saved graphics' own records read from public files and Revit's IFC exports of them; no Autodesk SDK source, disassembly or NDA material.

Breaking changes

None.

@DrunkOnJava DrunkOnJava added area:geometry Work in the geometry area. area:ifc Work in the ifc area. type:bug Correctness defect or regression. labels Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:geometry Work in the geometry area. area:ifc Work in the ifc area. type:bug Correctness defect or regression.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant