Skip to content

feat(ifc): a door's and a slab's IsExternal, from its type's Function (B28, #35) - #621

Merged
DrunkOnJava merged 7 commits into
mainfrom
feat/b28-external
Oct 3, 2026
Merged

DrunkOnJava merged 7 commits into
mainfrom
feat/b28-external

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

RE-158 (#620): a door's and a floor's IsExternal is its type's FUNCTION_PARAM (-1001006: Interior 0, Exterior 1), an i64 id followed by a u32 in the type's own data object (5 of 5 RE1 doors, interior and exterior; 2 of 2 floors).

  • partition_room_parameters: FUNCTION_PARAMETER and scan_integer_parameter.
  • partition_schema_mvp: m_type_function on doors and slabs whose type is known.
  • export_content: IsExternal (IfcBoolean) in the element's Pset_DoorCommon or Pset_SlabCommon for Function 0 or 1, nothing otherwise.

The walls' IsExternal, LoadBearing and ExtendToStructure stay out: they never vary on RE1, so no parameter is identified (RE-158 §3).

Test: tests/is_external.rs (real target). Red on main: draft #618, run 37145114521, 7 of 7 missing; the output is in the test commit's message.


Note

Medium Risk
Changes IFC property-set output for doors and slabs and adds partition binary scanning; behavior is gated on Revit 2024+ and fail-closed on conflicting parameter reads, but export parity affects downstream IFC consumers.

Overview
RE-158 wires Revit type Function (FUNCTION_PARAM, interior 0 / exterior 1) from partition data into IFC IsExternal on doors and floor slabs, aligned with Revit's export.

Partition scanning adds scan_integer_parameter and FUNCTION_PARAMETER, used by attach_type_functions to set m_type_function on door and slab instances from their type ElementIds (Revit 2024+). During IFC export, add_is_external appends IsExternal (IfcBoolean) to Pset_DoorCommon or Pset_SlabCommon when Function is 0 or 1; other values are omitted.

A new corpus test tests/is_external.rs compares IsExternal on tagged elements against Revit's reference IFC for RE1 Architecture, and CI lists is_external as a real target.

Reviewed by Cursor Bugbot for commit 87cd770. Configure here.

tests/is_external.rs: on RE1 Architecture, every Pset_DoorCommon and
Pset_SlabCommon IsExternal Revit writes (5 doors, interior and exterior,
and 2 floors) must be rvt-rs's.

Red on main (draft #618, run 37145114521, Corpus health tier 2):

---- re1_door_and_slab_is_external_are_revits stdout ----
thread 're1_door_and_slab_is_external_are_revits' panicked at tests/is_external.rs:183:9:
RE1 Architecture: 7 of Revit's 7 door and slab IsExternal values are not
rvt-rs's ((tag, set), Revit's, rvt-rs's); first:
[(("416336", "Pset_DoorCommon"), "IFCBOOLEAN(.F.)", None),
 (("416703", "Pset_DoorCommon"), "IFCBOOLEAN(.F.)", None),
 (("416909", "Pset_DoorCommon"), "IFCBOOLEAN(.F.)", None),
 (("417097", "Pset_DoorCommon"), "IFCBOOLEAN(.F.)", None),
 (("418660", "Pset_SlabCommon"), "IFCBOOLEAN(. ...
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.67s
… (B28, #35)

RE-158: the door and floor types' FUNCTION_PARAM (-1001006) entry, an i64 id followed by a u32, is Revit's IsExternal on 5 of 5 RE1 doors (interior and exterior) and 2 of 2 floors.

- partition_room_parameters: FUNCTION_PARAMETER and scan_integer_parameter (the u32 after the id, in the element's own data object; disagreeing entries give nothing).
- partition_schema_mvp: m_type_function on doors and slabs whose type is known.
- export_content: IsExternal (IfcBoolean) in Pset_DoorCommon or Pset_SlabCommon for Function 0 or 1; nothing for another value, which RE1 does not show.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: IsExternal omitted without common pset
    • add_is_external now creates Pset_DoorCommon or Pset_SlabCommon with IsExternal when reference export did not already add that common set.

Create PR

Or push these changes by commenting:

@cursor push 5c89ad200b
Preview (5c89ad200b)
diff --git a/src/ifc/export_content.rs b/src/ifc/export_content.rs
--- a/src/ifc/export_content.rs
+++ b/src/ifc/export_content.rs
@@ -1075,7 +1075,7 @@
 /// slab's `Pset_SlabCommon` among `sets`, from its type's Function, 0
 /// interior or 1 exterior (RE-158). Nothing for another Function, which RE1
 /// does not show, or when the type's Function was not read.
-fn add_is_external(sets: &mut [PropertySet], ifc_type: &str, decoded: &DecodedElement) {
+fn add_is_external(sets: &mut Vec<PropertySet>, ifc_type: &str, decoded: &DecodedElement) {
     let common = match ifc_type {
         "IFCDOOR" => "Pset_DoorCommon",
         "IFCSLAB" => "Pset_SlabCommon",
@@ -1094,10 +1094,16 @@
         Some(1) => true,
         _ => return,
     };
+    let property = Property {
+        name: "IsExternal".into(),
+        value: PropertyValue::Boolean(external),
+    };
     if let Some(set) = sets.iter_mut().find(|set| set.name == common) {
-        set.properties.push(Property {
-            name: "IsExternal".into(),
-            value: PropertyValue::Boolean(external),
+        set.properties.push(property);
+    } else {
+        sets.push(PropertySet {
+            name: common.into(),
+            properties: vec![property],
         });
     }
 }

You can send follow-ups to the cloud agent here.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 87cd770. Configure here.

Comment thread src/ifc/export_content.rs Resolved
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 3, 2026 19:07
@DrunkOnJava
DrunkOnJava merged commit 358d91c into main Oct 3, 2026
23 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/b28-external branch October 3, 2026 19:41
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