Skip to content

fix(compare): read each file's lengths in its own unit - #1093

Merged
DrunkOnJava merged 3 commits into
mainfrom
fix/ifc-compare-units
Oct 29, 2026
Merged

DrunkOnJava merged 3 commits into
mainfrom
fix/ifc-compare-units

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

rvt-ifc-compare converts storey elevations and the bounding box to metres by each file's own LENGTHUNIT before comparing.

Motivation

The practitioner-workflow review of 2026-10-29 found the compare tool unit-blind: src/ifc/compare.rs read the raw trailing number of each IfcBuildingStorey and the raw IfcCartesianPoint coordinates, while rvt-rs writes metres and Revit's exports of the reference models are in feet (Core Interior) or millimetres (RE1, the BIM4LCA office). Every storey then showed as a difference.

Changes

  • src/ifc/compare.rs: length_unit_scale_to_metres (the IfcProject's UnitsInContext → IfcUnitAssignment → the LENGTHUNIT: an IfcSIUnit with its prefix, or an IfcConversionBasedUnit's IfcMeasureWithUnit ratio times its SI unit); summarize_ifc_step scales elevations and points by it; a file that declares no length unit is read as written.
  • tests/cli_real_files.rs: the RE1 compare test also asserts that storeys_only_left and storeys_only_right are empty against Revit's export.
  • docs/ifc-compare.md, changelog.d/fixed/ifc-compare-units.md.

Testing

Unit tests are banned in this repository: do not add them.

  • tools/check-local.sh: not run locally by policy; CI runs every gate.
  • End to end: ifc_compare_tells_an_export_from_itself_and_from_revits runs the built rvt-ifc and rvt-ifc-compare on RE1 Architecture (MIT) against Revit's own export, in the Corpus health job.

Audit-honesty checklist

  • Docs and changelog fragment updated.
  • No emojis, private paths or internal jargon.

Legal and contribution hygiene

  • Apache-2.0; no Autodesk material.

Breaking changes

None to the API (one added function). Output: compare reports now give lengths in metres.

Related issues

Refs #874.

rvt-ifc-compare compared storey elevations and the bounding box as the
numbers each file writes, so an rvt-rs export (metres) against Revit's
(feet on Core Interior, millimetres on RE1 and the BIM4LCA office) differed
on every storey. summarize_ifc_step now scales both by the file's
LENGTHUNIT (compare::length_unit_scale_to_metres: an IfcSIUnit with its
prefix, or an IfcConversionBasedUnit's ratio times its SI unit). The RE1
compare test now also checks that no storey is on one side only.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 07ea8d1f32

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/ifc/compare.rs Resolved
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 29, 2026 20:33
@DrunkOnJava
DrunkOnJava merged commit 3fe6106 into main Oct 29, 2026
28 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/ifc-compare-units branch October 29, 2026 21:00
DrunkOnJava added a commit that referenced this pull request Oct 29, 2026
DrunkOnJava added a commit that referenced this pull request Oct 29, 2026
…evit's own (#874) (#1096)

## Summary

Part of #874 (P1: three practitioners' reports on their own models).

- `.github/ISSUE_TEMPLATE/practitioner_report.yml`: an issue form that
asks for what P1 needs and never for a model file: the reporter's work,
the rvt-rs version, each model's release, discipline and size, which
workflow steps they ran (install, open, inspect, export, compare with
Revit's own IFC, open in other software), the Revit export setup
compared against, findings, and whether the report may count toward P1.
It points at `--anonymize` and the diagnostics sidecar.
- `docs/user-guide.md`: a "Compare with Revit's own export" section. It
says which frame rvt-rs writes (IFC4, metres, the internal origin,
`IfcSite` at identity, no latitude, longitude or `IfcMapConversion`),
that a shared-coordinates or survey-point export sits elsewhere, and
that which Revit coordinate base matches best is untested. It shows the
`rvt-ifc` and `rvt-ifc-compare` commands and links the form from the
"report a problem" steps.

It also says `rvt-ifc-compare` reads each file in its own length unit,
true since #1093. `--anonymize` is described as covering the diagnostics
and the inspect report, not the IFC, in the form and in the guide's
existing section.

## Verification

- The form parses as YAML; both labels (`area:product`, `needs-triage`)
exist.
- `rvt-ifc-compare --json` and `rvt-ifc --anonymize --diagnostics` are
existing flags (src/bin/rvt_ifc_compare.rs:32, user guide's existing
anonymize section).

Docs only; no export changes.
Repository owner deleted a comment from chatgpt-codex-connector Bot Oct 31, 2026
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