Repository navigation
research(families): rebuild a family's extrusions from their sketch curves, and an opt-in rvt-ifc --family-extrusions (#156) (RE-327) - #1342
Merged
Conversation
…h and saved-graphics records (#156) (RE-326)
…oom-phase lane's (#156) (RE-327)
… the project index, and a second discovery probe (#156) (RE-327)
…urve records and measure them against the saved meshes (#156) (RE-327)
… each extrusion's profile is projected into its sketch plane's frame (#156) (RE-327)
…d the probe records what orients a sketch plane's normal (#156) (RE-327)
…s by where they lie, and the probe records each plane's normal and each open loop's gaps (#156) (RE-327)
…ts family's own extrusions where they reproduce its saved mesh, and RE-327's report (#156) (RE-327)
…own-facing plane that reads no reference normal is refused, and the flag is documented (#156) (RE-327)
…ould land # Conflicts: # docs/format-reconnaissance.md
…stream once (#156) (RE-327)
…c line sums to its candidates, an up-facing flipped plane is refused, and a scorer for the extrusion bodies (#156) (RE-327)
…export pipeline (#156) (RE-327)
… so clippy's doc_lazy_continuation passes (#156) (RE-327)
…wn tolerances: chord loss for volume, 1e-4 ft for vertices, 1.1e-3 ft for surface samples (#156) (RE-327)
…ntity and flag runs, and the one body that failed the saved-mesh bar (#156) (RE-327)
… its mesh, since Revit's own arc tessellation can be out of phase with ours by 0.0014 ft (#156) (RE-327)
…he runs that show why (#156) (RE-327)
DrunkOnJava
marked this pull request as ready for review
November 4, 2026 10:29
DrunkOnJava
enabled auto-merge (squash)
November 4, 2026 11:54
14 of 15 tasks
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
Rebuilds a family's extrusions from their own sketch curve records (sketch curves, closed loops, extrusion parameters, solids: the chain Discussion #112 reports) and measures them against the mesh Revit saved for each form. Adds the opt-in
rvt-ifc --family-extrusions, which draws a family instance from its family's extrusions where they reproduce its saved mesh. Draft: the export is measured on lines only (the arcs are an open call, below).Motivation
#156 asks for an independent reproduction of the sketch-to-solid pipeline STE1200's team reported (85 of 86 extrusions of one family). RE-327's report is the evidence layer: where the records are on Revit 2015 to 2027, the rule that places the solid, and what is measured against what.
Changes
src/research/native_form_geometry.rs(new): a family file's own records without the project index (native_documentrefuses every.rfa); the sketch chain (GLineandGArcof theCurveElemrecords, loops, outlines and holes, theSketchPlaneframe, the twoDoubleparameters) and the solid;mesh_agreement.src/research/native_family_forms.rs:family_records_in(family_recordson any native release, optionally for given ids);family_recordsunchanged.src/ifc/family_extrusions.rs(new),ExportOptions::with_family_extrusionsandExportNote::FamilyExtrusionsin the shared export pipeline, andrvt-ifc --family-extrusions: off by default, implies--saved-meshes, default export unchanged. An instance whose body is its saved mesh becomesIfcExtrudedAreaSolids overIfcIndexedPolyCurveprofiles of straight segments, placed by the instance's transform into the framesaved_meshes::attachputs the mesh in, where its family's extrusions reproduce that mesh (every vertex within 0.0001 ft of their surfaces, surface samples within 0.0011 ft of the mesh, volumes within the arcs' chord loss and 0.01%), checked for each instance on its own; otherwise it keeps the mesh, as it does for any instance with an arc in a profile. Only a family'sExtrusionElem,CurveElemandSketchPlanerecords are read: a family with a void, or an extrusion that does not rebuild (an ellipse, an unclosed sketch), draws nothing; other forms it holds and an unreadVisibleflag are not seen, and the per-instance check against the instance's own mesh is what refuses an instance they make differ. Revit 2024 to 2027 (measured on 2024 and 2025): an earlier file has no instance transform that reads (Einhoven: 11 unplaced, 0 replaced), and a reflected instance's is never read. A replaced family instance written asIfcSpacegetsSpaceOutlineSourcefamily_body, with itsBodySourcefamily_extrusions, instead of the stalesaved_mesh.family_extrusions::attach_with_controlchecks aWalkerControlbetween its reads and for each instance, andrun_exportpasses it. The linervt-ifcprints splits the candidates into replaced, no rebuilt family, no transform, mesh too large, volume, vertices, surface, arc, unwritable and ambiguous.tools/re/family_extrusion_bodies_vs_ifc.py:mesh_bodies_vs_ifcon the bodies whoseBodySourceisfamily_extrusions.Curve::range_alongno longer overflows); a sketch of more than 4,096 curves is refused before it is read, and the quadratic comparison of a sketch with its stored loops runs only up to 256 curves; the polygon count is taken before any polygon is built; the vertex pass ofmesh_agreementis bounded by the pair budget (a mesh over it isuncheckedand keeps its body); a curve record seen in two partition copies is listed once.docs/support-matrix.json(family-extrusion-bodies, experimental) anddocs/evidence.mdrows for the flag.probes/examples/probe_re327_family_extrusions.rs,reports/element-framing/RE-327-family-extrusions.md, addenda indocs/format-reconnaissance.mdanddocs/status.md, the flag inREADME.md,docs/compatibility.mdanddocs/supported-profile.md, changelog fragments (research/andadded/).Testing
Unit tests are banned in this repository: none added. The probe and the Measure runs are the end-to-end evidence; nothing was built or run locally.
tools/check-local.shpasses: run by CI on this PR (nothing is built locally).cargo fmt --all,tools/release/changelog.py checkandtools/ci/api-doc-ids.pypass locally.phi-ag/rvt, 12 releases) and Autodesk's 58 sample projects (2015 to 2027, fetched for the run, never stored); the numbers and the script are in the report. The probe at the headaaa38de8: run 41805344172.aaa38de8,-f base=main -f holdout=true -f nordic=true,core-interior re1-* einhoven nordic-office-* holdout-* spent-*): 29 models with a hash on both sides, 29 the same, none moved, the 18 held-out models and the spent pair included (hashes only). The unfiltered run atb13be61a(41801584312) had 105 the same, none moved, and the six held-out models on the head side only, which this run supplies. Runs 41808993073 (b482eba2), 41811173603 (0b286d83) and 41813677577 (9f3814f6, withmainat999fc7b3merged in) repeat it: 29 of 29 the same, each. Run 41816308266 (9412048f, the head) takes every model (-f base=main -f nordic=true -f r2025=true -f samples=true -f holdout=true -f families=true -f scorers=none): 111 with a hash on both sides, 111 the same, none moved.--saved-meshesalone), every IFC scorer plusfamily_extrusion_bodies_vs_ifc:aaa38de8, arcs drawn as arcs): 335 bodies replaced (Core Interior 37, the BIM4LCA office as built and at permit 129 each, its two terrain variants 11 each, RE1 Architecture 8, Electrical 8, Mechanical 1, Plumbing 1). The body scorer matched 251: 250 have Revit's vertices within 0.001 ft of rvt-rs's surface (most within 1e-5 ft), and one, RE1 Architecture's 'Dispenser, Toilet Paper' (element 360331), has them 0.001439 ft away (0.0009143 ft as its saved mesh): a blocker under the saved-mesh bar. The other 84 are family instances written as spaces, scored byspace_profiles_vs_ifc. Every scorer row was the baseline's or better (the office files' bodies within 0.01% of Revit's volume 1,547 and 1,633 to 1,625 and 1,711), but for that one.b482eba2): the export's tolerances narrowed to the sample projects' own (1e-4 ft at a vertex, 1.1e-3 ft at a surface sample, the chord loss and 0.01% in volume, from 5e-4 ft, 1.5e-3 ft and 1%). The same 335 bodies, the dispenser unchanged at 0.001439 ft: the extrusions agree with its saved mesh to 1e-4 ft, so the tolerances were not the cause. The volumes say what is: Revit's export is a coarse tessellation of arcs of its own, and where its vertices fall at other angles than ours it is up to a chord's sagitta off (an inference, not a measurement of the dispenser's profile).0b286d83), repeated at the head9412048fby 41816314683 after the review fixes with the same result: an instance with an arc in a profile keeps its mesh. 64 bodies are replaced (Core Interior 37, each office file 9, RE1 Architecture 6, Electrical 2, Mechanical 1) and all 64 pass "ref on ours"; every combined row ofmesh_bodies_vs_ifcandsaved_meshes_vs_ifcequals the baseline's in every column, and every other scorer,space_profiles_vs_ifcincluded, is identical. Nothing got worse and, with the arcs out, nothing got better. It leaves out 271 of the first run's 335 (the office files 120 each, the terrain files 11 each, Architecture 2, Electrical 6, Plumbing 1), of which 270 held the bar and gained what the first run shows.Measured against the saved meshes (the probe at
aaa38de8, run 41805344172):m_alwaysRefPlaneNormfalse): the rule was found on those 79 and is not held out, and it runs by default in the reader; what tests it is the export, which checks every instance against its own mesh. One up-facing flipped plane that differed is refused, and refusing an unreadm_flipZcost none of the 6,172. 29 partial meshes are outside the verdict; 3,222 built forms have no mesh (902 voids); 164 are not built (137 ellipses, 26 open sketches, the flipped plane).m_flipZapplies.VarSketchis refused on Revit 2015 to 2017 (VarParam::m_pSubst, RE-323 §5): a measured negative that the rebuild does not depend on.native record framing is unvalidated for Revit 2014).Audit-honesty checklist
--saved-meshes, and its measured state (one arc-bearing body failed the bar, so arcs keep the mesh) is in the report,docs/status.mdanddocs/supported-profile.md.changelog.d/research/327-family-extrusions.md,changelog.d/added/327-family-extrusions-flag.md.probes/examples/and a dated addendum todocs/format-reconnaissance.mdare included.Legal and contribution hygiene
phi-ag/rvtcorpus and Autodesk's sample projects), the class and field names of each file's ownFormats/Latest, prior public reverse-engineering work (Discussion Set of findings #112: STE1200's team and jakobhirn-bit), and buildingSMART's IFC4 specification. I have not used Autodesk SDK source, ODA SDK source, leaked internal documentation, NDA material, or decompiled internal Revit implementation code beyond public symbol exports, and I have not copied or translated code from revit-ifc.Breaking changes
None.
rvt::ifc::family_extrusionsis a new public module andExportNoteandExportOptions(both#[non_exhaustive]) gain a variant and a field; the default export is unchanged.Screenshots or output samples
The per-form lines and the tallies are in each run's
family-<file>/probe.txtandsample-<file>/probe.txt. Reproduce the probe:gh workflow run measure.yml --ref main -f ref=aaa38de808f1731acf6f6a6dace59904f873335b -f base=none -f probe=probe_re327_family_extrusions -f families=true -f samples=true -f sample_years="2015 2027" -f scorers=none -f models=-. The flag run's command is in the report's §9.Related issues
Refs #156. Follow-up for the arcs: #1346 (milestone 0.15.0). Discussion #112. Credit: STE1200's team (the chain and the unit trap) and jakobhirn-bit.