Skip to content

Write no IFC body for a part with coincident end points - #48

Merged
mahach666 merged 1 commit into
mainfrom
fix/ifc-degenerate-axis
Nov 28, 2026
Merged

mahach666 merged 1 commit into
mainfrom
fix/ifc-degenerate-axis

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

What changes and why

For a part whose end points are less than 0.001 mm apart, the scene output reports no usable geometry and emits no mesh. The IFC output still wrote a box of no or nearly no length for it (along the X axis when the points coincide), and tdbio counted it as a proxy box.

  • The IFC output keeps the element of such a part, with its placement, tag and GlobalId, and gives it no representation. The limit is the same as in the scene output.
  • The proxy box warning of tdbio export --ifc counts only the parts that have a body.
  • The box writer now returns before it reads the profile name, so the IFC output no longer reads dimensions for such a part.
  • docs/cli.md and the CHANGELOG entry for the IFC output say so. No public API changes.

Known limit: the IFC export prints only the count. It does not list the parts without a body, and it prints no warning when no part has one.

How it was checked

  • dotnet build TdbIO.slnx -c Release has no warnings
  • dotnet test TdbIO.slnx -c Release passes: on net8.0 and net10.0, TdbIO.Tests 499 passed and 38 skipped (private inputs), TdbIO.Scene.Tests 13 passed
  • Output of tdbio info, tdbio tables and tdbio text on the same files is identical before and after: 18 of 18 runs, with and without --json, on three synthetic models
  • No Tekla models, customer data or vendor files are added

New tests: five library cases on both sides of the limit, in millimetres and metres, and a command line export of a normal part and a part with coincident ends. Both elements stay with their tags, only one refers to a shape, and the warning says 1 of 2. Against the code before the change, this command line test fails with 2 of 2.

The native engine build of TdbIO.Scene (-p:BuildNativeCoreOnly=true), dotnet pack with the package validation against 0.1.0 forced to run, and git diff --check pass.

Export comparison

tdbio on net8.0, before and after, on three synthetic models: one normal part; a second part whose ends are one point; a second part whose ends are two points with the same coordinates.

  • JSON: identical byte for byte on all three.
  • Scene JSON: identical on all three except CreatedAt, which holds the time of the run. Its warnings are identical.
  • IFC with the normal part only: identical once the export times, the random identifiers and the random temporary name in FILE_NAME are replaced.
  • IFC with two parts, both variants: the warning goes from 2 of 2 to 1 of 2 and the faceted breps from 2 to 1. Before, the body of the second part measured 0 × 0.15 × 0.15 m; after, it has none. Both elements keep their tags and GlobalIds, and no reference is left dangling.
  • The two-part files, loaded with ifcopenshell 0.8.4: schema validation with EXPRESS rules reports nothing before or after. The same validation does report a deliberately broken copy.

Not run: private test files and real models, and local runs on Linux or macOS.

For a part whose end points are less than 0.001 mm apart, the IFC output
wrote a box of no or nearly no length, and tdbio counted it as a proxy box.
Its element and ID now stay without a representation, as the scene output
already gives such a part no mesh, and the warning counts only the parts
that have a body.
@mahach666
mahach666 merged commit 2f304b0 into main Nov 28, 2026
5 checks passed
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