Repository navigation
ci: the readers census reads a body saved as a triangle mesh from the IFC and meshes the others on every core (#1616) - #1622
Merged
Conversation
… IFC and meshes the others on every core (#1616) tools/re/save_pair_bodies.py meshed each of the 5,527 bodies of a Revit 2026 rac_advanced save with its own create_shape call, which builds an OpenCASCADE face from every triangle of a saved mesh and meshes it again. The census of tools/re/readers_across_saves.py does that for both saves of a pair, and a profile of the gates on rac_basic puts 96% of their time there: two sanitary terminals of 163,040 triangles took 40% of it. A body that is one IfcTriangulatedFaceSet with no opening cut from it is now read from the file: its triangles, placed by its ObjectPlacement and scaled to metres. Every other body goes through IfcOpenShell's iterator on all cores in one call. Against the old meshing, on the kept exports of the Revit 2025 and 2026 saves of rac_basic, rac_advanced and rst_basic, and of Core Interior: the same bodies, the same ones that did not mesh, the same classes and sources, world boxes identical to the last bit, and volumes within 9.2e-5 of the old (one door of rac_basic; 9e-9 on rac_advanced, 6e-11 on rst_basic), against a tolerance of 1e-3.
…triangles use (#1616) A point list can hold points no triangle indexes: the writer appends each saved primitive's whole vertex array, and 155 of the office's 11,084 face sets hold some, up to 481 in one. IfcOpenShell's meshing only ever saw the vertices of the triangles, so the box of a body read from the file moved with such a point where the old box did not: on a copy with one unused point 500 m away the volume was equal and the box moved 499.9 m. None lies outside its triangles' box in the files measured, so no gate text changed, but another model could turn a pair red. The corners are now those of verts[np.unique(faces)] for every body, the two paths alike. The volume is untouched. Found by rvtDevelop's second read of #1622.
DrunkOnJava
marked this pull request as ready for review
November 9, 2026 18:43
Owner
Author
|
The gates-only Measure on the final head (bc9fb93, after the box fix; 42675088490) finished after the merge, because |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tools/re/save_pair_bodies.py, which the census oftools/re/readers_across_saves.pymeshes every body of two saves with, now reads a body Revit saved as a triangle mesh from the IFC and meshes every other body in one call on all cores. The numbers it compares are the old ones: the same bodies, world boxes identical to the last bit, volumes within 9.2e-5 of the old against a tolerance of 1e-3, and no verdict of any pair changes.Motivation
#1616: the
samples-2024-2099shard of Measure takes 34 to 50 minutes of its 90 on the saved-mesh default (#1610), where it took 11. With each body meshed by its owncreate_shapecall, a Revit 2026 save of rac_advanced took 52 of 55 s of the census's meshing, and a profile ofbodies_across_saves.pyon the 2026 and 2025 saves of rac_basic (59.3 s, with the meshing already on all cores) puts 57.6 s in the census ofreaders_across_saves.pyand 56.1 s of those in IfcOpenShell's iterator. IfcOpenShell builds an OpenCASCADE face from each triangle of anIfcTriangulatedFaceSetand meshes it again. Timed element by element (onecreate_shapeeach, on a Mac carrying other work, 106 s in all): two sanitary terminals of 163,040 triangles took 22.3 s and 20.3 s and 23 footings of 2,936 triangles 26.4 s, and of rac_basic's 441 bodies 314 are triangle meshes. The triangles are what the census compares, and they are in the file.Changes
tools/re/save_pair_bodies.py:face_set_mesh(new): a product whose oneBodyrepresentation holds oneIfcTriangulatedFaceSet(noPnIndex, a 3D point list, indices in range) and that has noHasOpeningsis read as its points through itsObjectPlacement(ifcopenshell.util.placement.get_local_placement) and the unit scale, with the file's own triangles. Anything else returnsNone.bodies(): pairs and Tag rules unchanged (a Tag more than one product carries is still not scored; a product with no Tag is still counted apart). Face sets are read; the rest is meshed by IfcOpenShell's iterator on every core, one call, where it was onecreate_shapeper element. A body the iterator does not return did not mesh, as one that raised did. The volume is the same formula about the world's origin.Testing
Unit tests are banned here, and none is added. The old and the new
bodies()were run on the kept exports of Measure's samples (keep_ifc=true, Revit 2025 and 2026 saves of each project) and compared body by body (the harness imports the twobodies()and prints the figures below; the old one isgit show cbeba4c7:tools/re/save_pair_bodies.py):The same Tags, the same bodies that did not mesh (none), the same class and
BodySourceon every body. The seconds are one run each on a Mac carrying other work (its load average was above 100 for the longer runs, and several runs went at once), so they are indicative; the gates' own time on Measure's runners is below. The one volume that moves by more than 1e-6 is a door of rac_basic 17 m from the world's origin: its triangles do not share their corners to the last micron, IfcOpenShell joins those corners and the file's triangles are not joined, so the volume about the world's origin takes each gap times its distance. That is 9.2e-5 of the door's volume against the census's tolerance of 1e-3; no other body is above 7.1e-7.Verdicts, the census's own comparison (
same(), world box 3 mm and volume 0.1%) over every body present in both the 2025 and 2026 saves, with each implementation's bodies: rac_basic 441 pairs, 440 the same in both; rst_basic 453, all the same in both; rac_advanced 5,527, 5,523 the same in both; no verdict differs.rme_advanced and rme_basic (about 6,600 bodies a save, 94 and 100 MB exports) were not compared body by body here: the old meshing takes too long on a loaded Mac. The Measure run below holds them to the same gates as the base side's.
Measure. Run 42668227629 (
-f ref=625537fe187a2bf90d8f1730c52aae41db9ee831 -f base=none -f samples=true -f sample_years="2024 2027" -f scorers=bodies_across_saves, from this branch) holds the 2024 to 2027 saves of every sample project to the gates on this head.same-project gatescheck run on this commit: pass, 15 samples held to their earlier saves, and the Areas on 4 saves.rac_advanced,rac_basic,rme_advanced,rme_basicandrst_basic) is byte for byte what Measure run 42647512042 wrote (the old meshing, feat(ifc)!: every element that would be a box in a Revit 2023 to 2027 file is drawn from the mesh Revit saved for it by default (#1191) #1610's head): 15 of 15, volumes to the six digits it prints included. That covers the two MEP samples that were not compared body by body above.timings.log(bodies_across_saves, seconds, the two runs on GitHub's runners):rac_advanced2026 / 2027rac_basic2026 / 2027rme_advanced2026 / 2027rme_basic2026 / 2027rst_basic2026 / 2027The shard's own time is more than the gates: each sample's schema step (
schema-validate-rules, IfcOpenShell's WHERE rules, 112 s onrac_advanced2026 and 248 s onrme_advanced2026) is the other large part of an item, so #1616 stays open for it.tools/check-local.sh: N/A, no Rust or workflow change (a Python file undertools/re/that Measure runs).Audit-honesty checklist
Legal and contribution hygiene
Breaking changes
None.
Related issues
Refs #1616 (its "done when" is the heaviest job of a
samples=truerun under about 45 minutes; this PR takes the gates' share, and the schema step is the rest).