Repository navigation
feat(saved-graphics): a cylinder face bounded by two trim loops, a hole, two regions or a seamless tube, is meshed (#1191) - #2102
Conversation
…e height each, a tube with no seam edge, is meshed as the whole rectangle of its parameters (#1191)
…ame the two-loop reader, and its rings sit exactly on the rectangle the mesher tests for (#1191)
…are refused by which pair they are, a hole, two regions or an open loop (#1191)
…n, a hole or two regions, is meshed band by band across its strips (#1191)
|
The three probe runs, read (each on the BIM4LCA office and housing as built against
As registered, the failing bodies are read face by face before anything else, and this stays a draft. The next read is one |
… and joins a loop either way round (#2102)
|
The face-by-face read of
So the two differences row 2 measures on these bodies come from Revit's export drawing the round bar with a few large flats. The body has 1.11 of Revit's volume (the bar 1.29), and rvt-rs's points stand up to 0.0116 ft off Revit's. Revit's flats are a square along the legs and, on the U-bend, straight pieces whose ends lie on rvt-rs's round. Row 2 stays failed on these 30 bodies. They ship drawn round, as the file saves them, with that miss on record (decided 2026-11-20; RE-494). The four sauna doors pass row 2 as registered. The "0.01 ft" count takes the larger of the two directions, and all four are within it and within 1 per cent of Revit's volume. Their "0.001 ft" and "ref on ours" counts fail. Revit writes the doors as explicit facets too (14 |
…stay refused, since no saved file read has one (#1191) The loops probe found no such face on the BIM4LCA office and housing or on any 2024 to 2027 Autodesk sample: every two-loop cylinder face there covers part of a turn and is meshed by band_mesh. tube_trim and the open ring it needed are removed, so ring_impl is as on main.
…part of a turn, and the grab bars Revit's export draws square (#2102) (RE-494)
…he counts as read (#2102) (RE-494)
|
@DrunkOnJava I tried For the strip from In a scratch variant, I kept the endpoint range checks and used Would a small midpoint-membership patch with a synthetic contract case be useful on this PR, or would you prefer it as a follow-up after #2102 lands? I can run whichever version you prefer locally and share aggregate decoder outcomes. |
…2106) ## Summary Count a cylinder trim edge only when it crosses the midpoint of the open U strip. The endpoint tolerance still checks that the edge spans the strip. ## Motivation The two-loop cylinder path added by #2102 can count an edge outside a very narrow strip. It retains U knots at a tighter tolerance than the endpoint coverage check. On the synthetic two-ring case the wider check counts five crossings where the midpoint has four, and refuses the trim. ## Changes - Use the strip midpoint for crossing membership in `band_mesh`. - ~~Add a synthetic cylinder contract through the public research decoder.~~ The case is tested beside `band_mesh` as a pure helper's failure modes (`327a710f`, by the maintainer; see the review comment), and `05b94b05` keeps each crossing on its ring edge. - A changelog fragment. ## Testing - Merged main at `d450e954` with the new contract fails with `cylinder trim rings cross a strip an odd number of times`. - With the patch, `cargo test --offline -p rvt --profile ci --test integration cylinder_trim_contract::` passes. The recovered synthetic UV area is `3.000000000600`. - `cargo fmt --all -- --check`, `tools/ci/verify-real-files.sh --check-only`, and `python3 tools/release/changelog.py check` passed. - `tools/check-local.sh` passed with its default checks. The optional external corpus and new Measure run remain pending. - The local private validation cleared this refusal and kept the other incomplete faces visible in diagnostics. A new public real-file Measure run would establish the wider export impact. **Maintainer's note:** the first commit's contract is now three tests in `src/research/native_saved_mesh.rs`'s test module, which CI's `cargo test --profile ci --lib` runs (all three pass on `05b94b05`); the Testing lines above describe the first commit. ## Audit-honesty checklist - The case verifies crossing membership and hole preservation on synthetic geometry. - The changelog records this narrow correction. - Broader export fidelity and performance are outside the synthetic contract. ## Legal and contribution hygiene - The changes are suitable for Apache-2.0. - The contract uses an independently generated synthetic graph. - The diff contains generic source changes, synthetic test values, and its registration. ## Breaking changes None. ## Output samples ```text before: cylinder trim rings cross a strip an odd number of times after: cylinder_two_loops_keep_the_hole_across_close_u_knots ... ok ``` ## Related issues Refs #1191 and #2102. Follow-up to the [synthetic reproduction](#2102 (comment)). --------- Co-authored-by: Griffin Long <[email protected]>
On the full Measure, rows 1, 3, 4 and 5 hold. Row 2 fails only on the BIM4LCA offices' 30
Stay_Wall_Mounted_:VAR-1grab bars a file, which Revit's own export draws as a square along their legs (read). They ship drawn round, as the file saves them, with that miss on record (decided 2026-11-20). Report: RE-494.Summary
A cylinder face bounded by two trim loops on part of a turn is now meshed strip by strip (
band_mesh). Before, the saved-graphics mesher took one trim loop on a cylinder and refused any face with two asmultiple cylinder trim loops unsupported. Two loops making a full turn, and three or more loops, are still refused. The code is as atd46bfeff; the commits after it add the report, the changelog fragment and the docs.A full Measure of
1ab9c54eagainst main4e05cfb0(44649733126: nordic, r2025, samples, holdout, every scorer, exports kept) moves 27 of 120 exports. On 22 of them, bodies that were record boxes are now drawn from their saved meshes: 1,289 on the exports kept, and 10 on the held-out house. On the other five, the rac basic samples, only refusal texts move (row 4). The bodies newly drawn:IfcFurniture: 30 on each BIM4LCA office file, allStay_Wall_Mounted_:VAR-1. Row 2 fails on all 30: 1.11 of Revit's volume, rvt-rs's points up to 0.0116 ft off Revit's surface.IfcDoor: 4 on each BIM4LCA housing file (O-5:O-5.9x21sauna) and 10 on the held-out house. All pass row 2: within 0.01 ft both ways and within 1 per cent of Revit's volume.IfcPipeFitting(48 and 87) and oneIfcBuildingElementProxyon Autodesk's rme basic and advanced samples in every year they exist, 2023 to 2027.IfcAirTerminaland 36IfcDuctFitting(HVAC), 108IfcSanitaryTerminal(plumbing), 5IfcBuildingElementProxy(Trash Chute), anIfcColumnand anIfcElectricAppliance(architectural), and anIfcLightFixture(electrical). Revit has no export of these in Measure; how they were read is below.The grab bars fail because Revit's export draws the round bar with a few large flats. Along the legs it uses a square whose corners lie on rvt-rs's round (radius 0.0110 m). On the U-bend it uses straight pieces whose ends lie on that round. Both of Revit's shapes for them, 15 bodies each, read the same. Revit writes those flats itself (
IfcPolygonalFaceSet), so they are not IfcOpenShell's tessellation.d46bfeffremoves the full-turn reader,tube_trim, which no face on any file read took. A byte-identity Measure of it against1ab9c54e(44660808578: nordic, r2025, samples, holdout) leaves 120 of 120 exports and 102 of 102diagnostics.jsonidentical.Motivation
#1191 (W6). A census of
box_bodies_vs_ifcover the models with Revit's own export (Measure 44589336915, head side,5e36af9f, before #2099) counts, for each refusal reason, the bodies whose refusal names it alone. That is a lower bound of what each reason blocks: a face's first failing stage hides the ones behind it.multiple cylinder trim loops unsupportedis the largest such reason Revit's exports can check: named alone by 136 bodies, 30 on each BIM4LCA office file and 4 on each housing file.Probe runs said which shape those faces are:
probe_2102_cylinder_loopsat6327fb09, every 2024 to 2027 sample): every two-loop cylinder face covers part of a turn (1 to 51 faces a file), so none takes the full-turn path. 13 faces on each rme advanced and basic file and 3 on Snowdon architectural have three loops, and 2 on each rac advanced file have ten; all are still refused.Changes
src/research/native_saved_mesh.rs:cylinder_facereads a second trim loop. If the two make a full turn it refuses them astwo cylinder trim loops on a full turn unsupported; otherwise it reads both rings closed and meshes them withband_mesh.band_meshtakes the strips across U, whose edges fall on every ring point, so each ring edge crosses a strip whole or not at all. It covers each strip between its crossings taken in pairs by height, which is a hole and separate regions alike. The face's points are both rings', so the plane beside it rebuilds the same steps (refined_plane_edge). Three or more loops are still refused.Testing
Unit tests are banned in this repository. Rows registered before any run is read. The registration below is as written before the full Measure ran; each row's result follows it. A third probe run on the same two files (44641101362,
42a94918) was read for one question: are the bodies that named the reason alone drawn now? They are, and row 2 fails on the office (read), so no full Measure is run until those bodies are read face by face. The rows below are judged on a full Measure of the head that settles (nordic, r2025, samples, holdout, every scorer, exports kept).mesh_bodies_vs_ifc,saved_meshes_vs_ifc,roof_bodies_vs_ifcandstair_bodies_vs_ifc, no class's "ref on ours", "0.001 ft" or "0.01 ft" count falls, and no body leaves a volume bin it was in. Nopsets_vs_ifcorqtos_vs_ifcline moves.mesh_bodies_vs_ifcare pushed off the end of its list of the largest families by the new ones (PK-1:PK-1.3800on the offices,UO-3andUO-4on the housing). Nopsets_vs_ifcorqtos_vs_ifcline moves.door_bodies_vs_ifcmoves 4 housing doors from "mirror rule wrong" to "rvt-rs's box is Revit's".schema.txtmoves on 21 models. On each, the count of swept solids placed apart from their product falls by exactly the number of bodies newly drawn there. On Snowdon plumbing the export grows from 112 MiB to 130 MiB, past the 120 MiB Measure validates (ci(measure): Autodesk's samples are validated up to 120 MB, as the reference models are #1532), so Measure skipped it. Read locally with IfcOpenShell 0.9.0.post1 as Measure reads it (tools/ci/ifc_validate_summary.py --both): 0 validation findings and 0 EXPRESS-rule findings, as on main.mesh_bodies_vs_ifc's class counts, since its list of bodies holds only some andfar_vertices_vs_ifcdoes not readIfcFurniture. For each class that gains bodies, each count of bodies within a bar rises by as many as the class gains:A count that rises by less means a newly drawn body fails it, and those bodies are read face by face before anything lands.
IfcFurnitureon the four office files: 30 gained, each count rises by 0. Read face by face (comment): the faces meet within 0.001 ft, and Revit's export draws the round bar with a square along its legs and straight pieces on its U-bend.IfcDoor: on each housing file 4 gained, and the 0.01 ft and 1 per cent counts each rise by 4; on the held-out house 10 of 10. Their 0.001 ft and "ref on ours" counts do not rise (the comment reads one door).ring_implalso reads planar faces and the cylinder's one-loop rings, and a plane beside a two-loop cylinder now refines its edge on that cylinder's steps. On every export that moves, no body drawn from a saved mesh on both sides changes its mesh (ifc_body_diff.py's count, expected 0).d46bfeff,ring_implis as on main: the full-turn reader and the open ring it needed are removed.diagnostics.jsonrises, except where bodies leavemultiple cylinder trim loops unsupportedfor one of the new two-loop reasons or a later one. Each such move is listed by reason.a trim loop does not close in the surface's parameters; disconnected UV boundary; unsupported surface HermiteSurf, 21face regions need subdivision, 10unqualified collapsed ruled profiles; unqualified collapsed ruled trim, 6disconnected UV boundary. No body names a two-loop reason.1ab9c54e: "pass: 15 samples held to their earlier saves, and the Areas on 4 saves and on the 2021 save".d46bfeff's exports are byte-identical to it. The held-out house moves only by its 10 doors (row 2).diagnostics.json;What each outcome means, written before the run.
The outcome. Rows 1, 3, 4 and 5 hold, and row 2 checks the doors, which pass. Row 2 fails on the 30 grab bars a file, read face by face as registered: Revit's export draws the round bar as a square along its legs. Landing with row 2 failed on them is outside the outcomes registered above; it is Griffin's decision (2026-11-20), to ship them drawn round, as the file saves them, with the miss on record.
The bodies no Revit export in Measure scores (1,153 on the samples) were read four ways: against the record box each replaced (Revit's own box for the element, along its three axes), against Revit's IFC4 export of Snowdon architectural, against the VIM export of Snowdon, and with the crack probe.
Round Tee:Standard: 21 stop more than 1 cm short, up to 42 mm (36 mm the median of all 36). The four read by axis stop 42 mm short on the low side of two of the box's axes (extents 0.32, 0.30 and 0.32 m). 13 of the 404 air terminals (Supply Grille,Return Grille) stop 10 to 21 mm short on both sides of two axes. On two tees and two grilles read, the VIM's mesh has rvt-rs's height (0.2812 m and 0.1218 m) and its extents within 9 mm, so the space is in the box alone.IfcPolygonalFaceSet); which of their parts are round is not read.tools/re/footing_meshes_vs_vim.py --document HVAC|Plumbing:06e22382on every 2024 to 2027 sample (44663576285).Round Tee:Standard. Each has 32 boundary vertices beyond 0.001 ft, up to 0.00158 ft, all where one cylinder face meets another: 1,152 new gap vertices on bodies this change draws. The probe's commit holds1ab9c54ewith two probe commits on top. With two-loop faces marked (87b23899, 44679890567), each tee's 32 split evenly: 16 on its two-loop face stand off the one-loop cylinder beside it, and 16 on that cylinder stand off the two-loop face. So each face puts points on their shared edge that the other does not hold, the same kind as the 588 between two cylinders that RE-493 left on main. Putting both on the edge's saved points is not done here.Audit-honesty checklist
reports/element-framing/RE-494-cylinder-two-trim-loops.md), the changelog fragment and thedocs/format-reconnaissance.mdaddendum follow the decision on the 30 grab bars.Review
Self-approved by the maintainer session that wrote it, after reading the whole diff again at
968e15f8(src/research/native_saved_mesh.rs, the report, the changelog fragment and the three docs pages); the second reader is not running. The tees' gaps between two curved faces, and the column's at a plane, are tracked in #2104; Snowdon Plumbing's export passing the 120 MiB Measure validates, in #2103.Legal and contribution hygiene
Breaking changes
None: research module internals only.