Skip to content

feat(ifc): cut each window's opening from its type's Width, Height and Default Sill Height (#227) (RE-93) - #465

Merged
DrunkOnJava merged 1 commit into
mainfrom
feat/window-openings-from-type
Sep 28, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
feat/window-openings-from-type

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Windows cut Revit's opening, read from their type (RE-93, #227). A family type's value block (RE-77) holds its length parameters as:

f64 feet · ff × 8 · i64 parameter

The parameter is a BuiltInParameter's negative id (Width -1001301, Height -1001300), or a declared family parameter found by the name in its definition (0x56 bytes past its id). Revit's IFC4 export cuts a window's opening:

  • its type's Width wide, centred on the window's origin (RE-87) along its X axis;
  • its type's Height high, from 3.0 ft above the origin.

The 3.0 ft is the type's Default Sill Height. A window whose type stores Width, Height and Default Sill Height now takes that opening, and Revit's OverallWidth / OverallHeight.

Motivation

rvt-rs cut each window's record box, which takes in its trim: about 0.23 ft wider on each side, 0.26 ft lower and 0.19 ft higher than Revit's opening.

Results

Snowdon Towers' 68 windows against Revit's openings (opening_boxes_vs_ifc.py) main this PR
within 0.001 ft 0 56
within 1.0 ft 65 9
OverallWidth / OverallHeight equal to Revit's 0 56

Evidence limit (sill). The sill Revit uses is the instance's own sill height, which is not read:

  • the Double-Hung types store no Default Sill Height, yet their openings also start 3.0 ft above the origin;
  • every Snowdon window sits at its type's default.

So the opening is used only where the window's record box, its actual geometry, holds it with at most 0.5 ft to spare on every side. A window with a moved sill would have its box moved with it and keeps the box opening. No Snowdon window exercises that guard, so its effect is not measured. This was agreed in chat before implementing.

Not changed:

  • Double-Hung windows (10) and louvers (2) keep their box opening.
  • Doors keep their box opening. They split between Rough Width × Rough Height and Width + 0.208 ft by Height + 0.104 ft within one type, and what decides it is not read.

Changes

  • src/partition_type_parameters.rs: scan_partition_lengths, family_parameters_named, type_window_openings (WindowTypeOpening).
  • src/partition_schema_mvp.rs: attach_window_openings, WINDOW_OPENING_FIELDS, WindowOpening, window_opening_from_fields.
  • src/ifc/export_content.rs: WINDOW_OPENING_PROPERTIES on windows that carry an opening.
  • src/ifc/mod.rs: window_type_cut, which refines the RE-83 / RE-89 cut, with the record-box guard.
  • src/ifc/entities.rs: OpeningCut::z_range_feet, where the cut starts and how high it is.
  • src/ifc/step_writer.rs:
    • such a cut gets its own solid Position and depth;
    • a window's OverallHeight / OverallWidth are written from its opening.
  • examples/probe_re93_window_openings.rs, tools/re/opening_boxes_vs_ifc.py (openings compared in internal feet), reports/element-framing/RE-93-window-openings.md.
  • README, status, support matrix (new partial row), supported profile, recon addendum, CHANGELOG.

Testing

Unit tests are banned in this repository; none were added.

  • Gates: fmt, clippy -D warnings, rustdoc -D warnings, cargo +1.85.0 check, fuzz workspace check (--locked), and tools/ci/verify-real-files.sh --profile ci with both corpora.
  • End to end against Revit's own Snowdon Towers IFC4 with opening_boxes_vs_ifc.py, as in the table.
  • Snowdon Towers: only 56 IfcOpeningElement bodies change, and the same 56 windows gain their properties and overall size. All 56 overall sizes equal Revit's.
  • Byte-identical to main's apart from the timestamp: Snowdon structural, Core Interior, the four RE1 models, Einhoven, the MIT house (2024, 2025), Projeto1 and teste_export_2025. No witness observation changes.

Legal and contribution hygiene

  • Apache-2.0. Byte observations and comparisons with Revit's exported IFC. BuiltInParameter ids come from the public mcneel/rhino.inside-revit enum; no Autodesk code.

Breaking changes

ifc::entities::OpeningCut gains a field, z_range_feet (serde default None).

Related issues

Refs #227.


Note

Medium Risk
Changes IFC opening geometry and STEP serialization for windows and extends OpeningCut with a serde-default field; scope is gated to types with full parameters and a bounding-box guard, but export regressions are possible outside the measured Snowdon set.

Overview
Windows whose types expose Width, Height, and Default Sill Height now get IFC openings and properties aligned with Revit’s export instead of the instance bounding box.

The partition layer decodes type length parameters from value blocks (f64 · ff×8 · i64), resolves Default Sill Height by family parameter name, and attaches opening geometry (centre, axis, base, width, height) to upright windows via instance transforms. IFC export refines OpeningCut through window_type_cut (with a record-box trim guard), adds optional z_range_feet so opening solids sit at the sill and use type height, and writes OverallWidth / OverallHeight on IfcWindow. Doors, Double-Hung types without sill data, and louvers keep box openings.

On Snowdon Towers, 56 of 68 windows match Revit openings within 0.001 ft (previously none); other local corpora stay byte-identical aside from timestamps. Adds probe probe_re93_window_openings, scorer opening_boxes_vs_ifc.py, and RE-93 documentation.

Reviewed by Cursor Bugbot for commit 8f9126f. Configure here.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) September 28, 2026 06:48
@cursor

cursor Bot commented Sep 28, 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_a3520d66-c137-4cff-9679-eabea04caeef)

@DrunkOnJava
DrunkOnJava merged commit aaff62c into main Sep 28, 2026
20 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/window-openings-from-type branch September 28, 2026 06:51
DrunkOnJava added a commit that referenced this pull request Sep 28, 2026
…ough opening (#227) (RE-94) (#466)

## Summary

Doors that Revit cuts at their rough size get that opening (RE-94,
#227). Revit's IFC4 export cuts each Snowdon Towers door centred on its
origin along its X axis, from the origin up, in one of two sizes:
- the type's Rough Width × Rough Height (-1001305, -1001304), read with
RE-93's type-length reader;
- or a frame-sized opening that no stored value gives.

What decides it is the door's body. Every door cut at its rough size has
a body exactly Rough Height tall, and every other door's body is its
frame's height. rvt-rs's record box is that body. So a door whose record
box is its type's Rough Height tall now takes the rough opening, and
Revit's `OverallWidth` / `OverallHeight`.

## Results

| Snowdon Towers' 126 doors against Revit's openings
(`opening_boxes_vs_ifc.py`) | main | this PR |
|---|---:|---:|
| within 0.001 ft | 0 | 54 |
| within 0.1 ft | 121 | 68 |
| within 0.26 ft | 1 | 0 |
| over 1 ft | 4 | 4 |
| `OverallWidth` / `OverallHeight` equal to Revit's | 0 | 57 |

- The separation is measured on all 126 doors: 57 rough-sized doors all
have a body Rough Height tall, and none of the other 69 does. Doors of
one type fall on both sides.
- The 3 doors in tapered Solar Walls take the rough size along the wall
and in height. Across the wall they stay as before (RE-89's open case).
- Opening-only doors (RE-84) are left out. RE1 Architecture's cased
opening has a record box its Rough Height tall, but Revit cuts it 1.0 m
wide against a 1.1 m Rough Width.
- Frame-sized doors (67) keep their box opening.

Also here:
- RE-93's guard counted an opening edge on the box's own edge as outside
through round-off. It now allows 1e-6 ft, which lets 1 more door
through.
- The window-specific names from #465 are generalised:
`FILLER_OPENING_FIELDS`, `FillerOpening`, `filler_opening_from_fields`,
`FILLER_OPENING_PROPERTIES`, `filler_type_cut`.

## Changes

- src/partition_type_parameters.rs: `type_door_openings`
(`DoorTypeOpening`), and a shared `type_lengths`.
- src/partition_schema_mvp.rs:
- `attach_door_openings`, gated on `DOOR_ROUGH_HEIGHT_TOLERANCE_FEET`
and on the type drawing geometry;
  - `push_filler_opening`, shared with windows;
  - the opening steps now run after RE-84's opening-only marking.
- src/ifc/mod.rs: `filler_type_cut` also takes `IfcDoor`, and has the
edge tolerance.
- examples/probe_re94_door_openings.rs and
reports/element-framing/RE-94-door-openings.md.
- README, status, support matrix (the RE-93 row now covers doors),
supported profile, recon addendum, CHANGELOG.

## Testing

Unit tests are banned in this repository; none were added.

- [x] Gates: fmt, clippy -D warnings, rustdoc -D warnings, `cargo
+1.85.0 check`, fuzz workspace check (`--locked`), and
`tools/ci/verify-real-files.sh --profile ci` with both corpora.
- [x] End to end against Revit's own Snowdon Towers IFC4 with
`opening_boxes_vs_ifc.py`, as in the table. Windows are unchanged from
#465 (56 within 0.001 ft).
- [x] Snowdon Towers: only 57 door `IfcOpeningElement` bodies change,
and the same 57 doors gain properties and overall sizes, all equal to
Revit's.
- [x] Byte-identical to main's apart from the timestamp: Snowdon
structural, Core Interior, the four RE1 models, Einhoven, the MIT house
(2024, 2025), Projeto1 and teste_export_2025.

## Legal and contribution hygiene

- [x] Apache-2.0. Byte observations and comparisons with Revit's
exported IFC; no Autodesk code.

## Breaking changes

#465's public names are renamed, as listed above. Neither has been in a
release.

## Related issues

Refs #227.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes IFC opening geometry and renames pre-release public opening
APIs; impact is limited to export accuracy on qualifying doors with
regression scoring against Revit IFC.
> 
> **Overview**
> **Doors that Revit cuts at rough size** now get IFC wall openings from
the type’s **Rough Width × Rough Height**, centred on the instance
origin, with matching **`OverallWidth` / `OverallHeight`**—but only when
the door’s record box height matches **Rough Height** (within 1e-3 ft).
Frame-height bodies, opening-only types (RE-84), and doors that fail the
existing trim guard keep the bounding-box opening.
> 
> Implementation **generalises RE-93’s window path**: shared
**`FillerOpening`** / **`FILLER_OPENING_*`** fields,
**`push_filler_opening`**, **`type_door_openings`**, and
**`filler_type_cut`** (windows and **`IfcDoor`**). Door attachment runs
after opening-only marking. **`filler_type_cut`** also allows opening
edges on the box boundary (−1e-6 ft spare) so one more case passes the
guard.
> 
> Snowdon Towers: **54** doors within **0.001 ft** of Revit’s openings
(was 0); **57** overall sizes match Revit. Other local exports stay
byte-identical except timestamps. Docs, support matrix, changelog, probe
**`probe_re94_door_openings`**, and RE-94 report added.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
7aaab7b. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

1 participant