Skip to content

feat(ifc): export a slab sketched as separate pieces as one element per piece (#331) - #336

Merged
DrunkOnJava merged 1 commit into
mainfrom
feat/multi-piece-slabs
Sep 23, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
feat/multi-piece-slabs

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

A slab sketched as several separate loops is several pieces, and Revit's own export writes each as its own IfcSlab with the element's Tag, the second named …:2. rvt-rs now does the same. A plan profile keeps every separate loop as a piece with the voids inside it. The exporter writes the largest piece on the element and each further piece as another element with the same Tag and a :2, :3 suffix.

Motivation

Closes #331. RE-43 stopped such sketches from producing voids outside the outer loop, but left the five Snowdon slabs as record boxes (up to 38 times Revit's area).

Changes

  • src/element_record_plan_profiles.rs:
    • PlanPiece, and PlanProfile::pieces, which round-trips through the new m_plan_profile_pieces field;
    • plan_profile_from_segments classifies loops by containment depth (even: a piece; odd: a void of its container) and gives no profile when loops cross;
    • vertex_count covers every piece;
    • unit tests for two separate pieces, an island inside a void, and crossing loops.
  • src/ifc/export_content.rs: the record-geometry builder returns one body per further piece, and the element loop writes each as a copy of the element with the piece's profile and a :N name. ProfilePieceCount joins the property set. A unit test covers two pieces.
  • RE-43 report addendum, the plan-profile support-matrix row, README, and CHANGELOG (plus the RE-43 bullet corrected).

Measurements (Snowdon Towers Architectural, local only)

slab rvt-rs pieces Revit
1388180 2, each Revit's area to 0.01 m² 2 pieces
1388290 2, each Revit's area to 0.01 m² 2 pieces
1402063 2, each Revit's area to 0.01 m² 2 pieces
1404309 2, each Revit's area to 0.01 m² 2 pieces
1402277 3 one IfcSlab with three tessellated bodies

IfcOpenShell reports no issue on the export. Every element of Revit's export in the entities rvt-rs writes is still exported, and nothing else changes. Core Interior and RE1 Architecture export byte-identically. RE1 Electrical differs from the RE-43 build only by RE-42's fixture names.

Testing

  • tools/check-local.sh
  • Every integration test with the family corpus and the magnetar + RE1 project corpus
  • cargo +1.85.0 check --profile ci --all-targets, cargo +nightly check --manifest-path fuzz/Cargo.toml
  • python -m ifcopenshell.validate on the Snowdon export

Audit-honesty checklist

  • The fifth slab's structural difference (three elements against Revit's one element with three bodies) is stated.
  • No emojis, no private paths.

Legal and contribution hygiene

  • Apache-2.0
  • Clean-room: byte observations scored against Revit's own IFC export. No SDK source or decompiled material. Snowdon is measured locally and not committed.
  • No PII

Breaking changes

PlanProfile gains the public field pieces, so struct literals must set it. A multi-piece element exports as several IFC elements that share its Tag.

Related issues

Closes #331. Refs RE-43, RE-25.


Note

Medium Risk
Changes IFC entity cardinality and public PlanProfile shape; geometry logic is localized to slab sketch export with regression tests, but multi-element output can affect downstream consumers expecting one slab per Revit id.

Overview
Slabs sketched as several disconnected loops now export like Revit: one IFC building element per piece, instead of falling back to the record bounding box after RE-43 rejected invalid outer+void profiles (#331).

Plan profile recovery classifies closed loops by nesting depth (even depth → piece outer; odd → void inside its container). Separate islands become multiple PlanPiece values on PlanProfile, serialized via m_plan_profile_pieces; partially overlapping loops still yield no profile.

IFC export keeps the first piece on the original element and clones additional BuildingElement rows for each extra piece—same Tag, names suffixed :2, :3, each with its own extruded sketch profile. Diagnostics can record ProfilePieceCount.

Docs (CHANGELOG, README, support matrix, RE-43 addendum) and unit/integration tests cover two-rectangle slabs, islands-in-voids, and crossing loops.

Reviewed by Cursor Bugbot for commit c2cf28d. Configure here.

Edited 2026-11-15: absolute Snowdon Towers figures (positions, elevations, areas) are removed. The Snowdon files measured here have no licence, so only counts, lengths and differences from them are published.

@cursor

cursor Bot commented Sep 23, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_90f1ce56-2563-41fd-99c9-4d04e2b8b718)

@DrunkOnJava
DrunkOnJava merged commit d22c25e into main Sep 23, 2026
23 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/multi-piece-slabs branch September 23, 2026 07:38
DrunkOnJava added a commit that referenced this pull request Nov 15, 2026
…nces, never as positions, elevations, areas or volumes (#2066)

## Summary

The Snowdon Towers files the reports measure on (the `.rvt` and Revit's
IFC4 export from bldrs-ai/test-models, and the VIM edition) carry no
licence, so only counts, lengths and differences from them are
published. A sweep of the tree found absolute Snowdon figures in 28
files. Each is rewritten to the difference or length it stood for, or
dropped. Griffin chose the full cleanup: the repository here, and the
GitHub posts and release notes alongside it.

## Changes

- **Site transform** (rotation, translation, vertical shift):
`docs/reference-models.md`, RE-30, RE-52, RE-78, RE-83, and the export
note in `research/witness-registry.json`.
- **Room areas** (830902; 2181757's floor and sections; a record box):
`CHANGELOG.md`, `docs/status.md`, `docs/rooms.md`,
`docs/format-reconnaissance.md`, RE-374, and the rustdoc of
`ROOM_PRISM_HEIGHT_FEET` and the `stored_solid_edges` source.
- **Elevations and positions**: RE-33, RE-48, RE-49, RE-51, RE-52,
RE-59, RE-100, RE-101 and `probe_re99_shaft_openings`'s module doc.
Where a length or difference carries the point, it is given instead:
76.75 ft tall, 87.7 ft above the floor, 0.754 ft lower, 2.0 ft above it,
180 by 228 ft.
- **Volumes and areas**: a flight's volume (RE-47), a beam's section
area (RE-423, now a ratio of 0.58), and the #331 slab pieces' areas
(`CHANGELOG.md`).
- **Second pass** (`1893090c`, `f4856542`): this one read each table and
paragraph whose heading or neighbour names Snowdon, not only the lines
that do. It found:
  - two rooms' areas (RE-101);
- a door's positions across its wall in internal feet (RE-121, now
measured from the wall's face);
- four roofs' volumes against Revit's (RE-401, now the percentage over);
  - wall 1996082's tops (RE-383, now differences);
  - beam 627866's direction (RE-49, dropped).
  RE-383 and RE-49 are from rvtReview's read.

## Testing

Docs and doc comments only; no output changes.
- `git grep` finds none of the figures left.
- `research/witness-registry.json` still parses, and nothing hashes its
text.
- `tools/ci/api-doc-ids.py` passes.
- The two `src/` files change in `///` comments only, so arm with
`--no-gates "src/ changes are doc comments only; no output moves"`.

Outside the tree, done the same day:
- Ten posts are rewritten the same way, each with a dated edit note: PR
#1587's, #297's, #332's and #336's bodies, issue #331's and #309's
bodies, and comments on #1589, #295, #1165 and #1732.
- Their earlier revisions are being deleted from GitHub's edit history.
- The v0.17.0 release notes are fixed (release notes keep no public
history).

What cannot be withdrawn:
- the git history of `main`, which is not rewritten;
- the rustdoc of crate versions already published to docs.rs;
- notification emails already sent;
- GH Archive's copy of each post as first written.

## Audit-honesty checklist

- [x] No figure that a claim rests on is lost: every agreement is kept
as its difference or tolerance.

## Legal and contribution hygiene

- [x] Apache-2.0. Removes figures measured on unlicensed third-party
files.

## Breaking changes

None.

https://claude.ai/code/session_01TFTgj3Ddfs7cFGMNAgVAut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plan profiles: slabs sketched as several separate loops need one solid per piece

1 participant