Repository navigation
red: B43 duct Shape (scratch, do not merge) - #685
DrunkOnJava wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Shape test can pass empty
- The test now builds the reference shapes map first and requires all 25 rectangular ducts to have Shape in Revit's export before comparing, so an empty parse fails instead of passing on None versus None.
Or push these changes by commenting:
@cursor push 43af14e8a9
Preview (43af14e8a9)
diff --git a/tests/duct_segment_shape.rs b/tests/duct_segment_shape.rs
--- a/tests/duct_segment_shape.rs
+++ b/tests/duct_segment_shape.rs
@@ -105,15 +105,20 @@
return;
}
let step = std::fs::read_to_string(&reference).expect("reference IFC");
+ let theirs = shapes(&step);
// Revit also writes the set on Mechanical's pipes; the ducts are the
// elements whose ObjectType is a Rectangular Duct type.
let ducts: Vec<String> = entities(&step)
.values()
.filter(|(e, a)| e == "IFCFLOWSEGMENT" && a.contains("'Rectangular Duct:"))
.filter_map(|(_, a)| a.rsplit('\'').nth(1).map(str::to_string))
+ .filter(|tag| theirs.contains_key(tag))
.collect();
- assert_eq!(ducts.len(), 25, "Revit's ducts");
- let theirs = shapes(&step);
+ assert_eq!(
+ ducts.len(),
+ 25,
+ "Revit's ducts with Pset_DuctSegmentTypeCommon.Shape"
+ );
let mut rf = RevitFile::open(&rvt).expect("open");
let result = RvtDocExporter
.export_with_diagnostics(&mut rf)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 cd19466. Configure here.
| "{} of 25 ducts' Shape is not Revit's (Tag, Revit's, rvt-rs's), first 3: {:?}", | ||
| wrong.len(), | ||
| &wrong[..wrong.len().min(3)] | ||
| ); |
There was a problem hiding this comment.
Shape test can pass empty
Medium Severity
The check only compares theirs and ours per duct Tag, so None versus None counts as a match. It never requires that Revit's Pset_DuctSegmentTypeCommon.Shape was actually read. If shapes() misses those properties, all 25 ducts look equal and this red test goes green without any Shape on the rvt-rs side.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit cd19466. Configure here.
|
Red draft for B43; its run (37235152063) is recorded in the rebuilt PR's test commit. |
…e (B43) (#686) B59 reads a duct type's shape from its native record's sweep profile. Each duct now also carries it in Pset_DuctSegmentTypeCommon.Shape, written the way Revit's export writes it: an IfcPropertyEnumeratedValue of IfcLabel('RECTANGULAR') on RE1's ducts. The value is IFC's PEnum_DuctSegmentShape: RECTANGULAR, ROUND or FLATOVAL. A new PropertyValue::Enumerated carries it, and the viewer's property panel shows it as text. RE1 Mechanical's 25 ducts are all rectangular, so ROUND and FLATOVAL rest on IFC's enumeration alone. Red on draft #685 (run 37235152063, 25 of 25 missing); the output is in the test commit. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches IFC property serialization and duct export paths; incorrect enumerated encoding could break downstream BIM tools that read standard MEP property sets. > > **Overview** > Adds **`PropertyValue::Enumerated`** so the STEP writer can emit **`IfcPropertyEnumeratedValue`** (labels as `IFCLABEL`), and the viewer formats those values as text rather than numeric columns. > > Duct IFC export now writes **`Pset_DuctSegmentTypeCommon.Shape`** from the partition field **`m_duct_shape`**, populated when building ducts via **`NativeDuctShape::ifc_shape()`** (`RECTANGULAR`, `ROUND`, `FLATOVAL`). A corpus test compares all 25 RE1 Mechanical ducts against Revit’s reference IFC; CI registers **`duct_segment_shape`**. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 12fc679. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->



Red run for B43's test; the implementation lands in a rebuilt PR after B59 (#684).
Note
Low Risk
Test-only and CI manifest change; no production export logic is modified in this diff.
Overview
Adds a red integration test for B43 (#35): rvt-rs IFC export must match Revit’s
Pset_DuctSegmentTypeCommon.Shapeon each of the 25 rectangular ducts in RE1 Mechanical (IfcPropertyEnumeratedValue/RECTANGULAR), keyed by elementTag.The test parses Revit’s reference STEP and the exporter output via small STEP helpers, filters ducts by
IFCFLOWSEGMENT/ Rectangular DuctObjectType, and fails with a per-tag diff when Shape differs. It skips whenRVT_PROJECT_CORPUS_DIRor the RVT/IFC pair is missing.Registers
duct_segment_shapeunder the real CI target list intools/ci/test-targets.txtso the newtests/*.rstarget cannot run or skip silently. Exporter behavior is not changed here—the PR description positions this as a failing run until implementation lands after B59 (#684).Reviewed by Cursor Bugbot for commit cd19466. Configure here.