Skip to content

Report the approximate scene geometry in the export warnings - #46

Merged
mahach666 merged 2 commits into
mainfrom
feat/geometry-conversion-diagnostics
Nov 28, 2026
Merged

mahach666 merged 2 commits into
mainfrom
feat/geometry-conversion-diagnostics

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

Fixes #43.

TdbIO.Scene now reports what it did with the geometry of every part, and tdbio export surfaces it.

What changed

  • New TdbGeometryDiagnostic (Kind, ElementId, SourceId, Profile, Message) with kinds ProxyBox,
    FallbackDimensions and NoGeometry; TdbSceneResult.GeometryDiagnostics holds one record per part with a proxy
    box, per part whose profile was not recognized (the proxy box falls back to the default dimensions of
    150 mm x 150 mm) and per part with no usable geometry (no start or end point, or a degenerate axis).
    TdbSceneResult.PartCount is new.
  • tdbio export model.db1 viewer.html and tdbio export model.db1 model.scene.json --scene-json print the findings
    on standard error: a summary line per kind and up to 20 per-part detail lines per kind (the rest are counted in the
    summary; the full list stays in the API). Standard output keeps only the scene JSON or the HTML file. Exit code and
    JSON output are unchanged.
  • Scope documented in docs/cli.md (new "Scene and HTML geometry warnings" section, plus the export row in the
    command table), docs/public-api.md (new "Scene adapter" section), the README and the CHANGELOG.

Verification

  • dotnet test: TdbIO.Tests 493 passed / 38 skipped (private inputs), TdbIO.Scene.Tests 12 passed, on net8.0 and
    net10.0. New cases cover a recognized profile (proxy box, no fallback), an unrecognized profile (fallback
    dimensions), a degenerate axis, missing endpoints, the warning formatting and the 20-part detail cap; the two
    end-to-end CLI export tests now assert the warnings on stderr and that the JSON stays free of them.
  • dotnet pack of TdbIO.Scene passes the package validation against 0.1.0 (public API additions only).
  • dotnet build src/TdbIO.Scene -p:BuildNativeCoreOnly=true passes.
  • On a real 17 MB model: 15988 of 15988 parts use rectangular proxy boxes, 3446 unrecognized profiles summarized
    with 20 detail lines and a tail, 23 stderr lines total, 0 warnings in the scene JSON.

The geometry warnings printed part names taken from the model to standard
error as stored. A name with a line break or an escape sequence broke the
one-line format, could forge a warning line and reached the terminal, and
a name shared by many parts did not identify the part.

- Name a part by its source id (GUID, or part:{id}) in the messages.
- Drop the ProxyBox finding: every mesh is a proxy box, so the number of
  them is ElementsWithGeometry, and no record per part is needed.
- Say that default dimensions are used when none are read from the profile
  name. Dimensions read from a name are an estimate, not a check of the
  profile.
- Print the proxy box warning for the IFC export too.
- Correct the CHANGELOG and docs: the HTML viewer is not written to
  standard output.
@mahach666
mahach666 merged commit 7a5d657 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.

Report approximate or missing Tekla geometry in scene and HTML exports

1 participant