Skip to content

feat(parser): decode .nwd partition nodes and Navisworks 2026 geometry variants - #251

Merged
mahach666 merged 1 commit into
IOExtend:mainfrom
TobbenTT:fix/nwd-partition-nodes
Nov 17, 2026
Merged

mahach666 merged 1 commit into
IOExtend:mainfrom
TobbenTT:fix/nwd-partition-nodes

Conversation

@TobbenTT

Copy link
Copy Markdown
Contributor

Thank you for NwcIO, and for keeping the grammar and the notes so precise: they are what made these fixes possible.

Closes #250. Details of what was found are in the issue.

Summary

 HierarchyParser
-  32 => throw NotSupportedException
+  32 => ReadNode(32)
+          [str] (empty) + class-53 body (name = source file) + children
+          ReadPartitionTrailer(): read for length, only the leading 2 checked
 FragmentParser
-  pose: never null
+  pose: may be null -> Translation = class-93 c, identity rotation, scale 1
 GeometryRecordParser
-  triangles: no colour slot; lines: colour slot required
+  colour slot optional in both (triangle colours read for length and dropped)
-  UV widths bu, bv both non-zero
+  at least one non-zero
  • The CLI's --no-tree hint and the NotSupportedException wrapper in NwcIO.Scene go away, since nothing throws it any more. --no-tree itself stays.
  • The format notes (§2.2, §2.4, §2.6), README, getting-started, public-api, scene.md and test-fixtures.md now describe the new behaviour.
  • RealFixtureTests opens .nwd fixtures with their tree.

Evidence

  • Synthetic tests (no private data):
    • A partition with a real trailer.
    • Two partitions in a row.
    • A trailer whose leading int is not 2, which throws.
    • A fragment with a null pose.
    • Triangles with colours, lines without colours, and UV with one zero width (both orders).
    • Both zero widths, which still throws.
  • Tests that pinned the old limitation, now flipped: the CLI, ModelGraphReader, PartitionProps and Scene tests now open the partition file instead of expecting NotSupportedException. The partition fixture gained leaves at preorder 2 and 7, so F1's fragments link to them.
  • Before: the Navisworks 2026 .nwd from the issue failed in the geometry reader even with --no-tree, and in the tree reader with it.
    After: it opens with the tree, every geometry record decoded, no diagnostics.
  • Locally on net8.0 (the net10 SDK is not installed here, so CI will be the first net10 run):
    • NwcIO.Tests: 1286 passed, 11 skipped.
    • NwcIO.Scene.Tests: 98 passed, 1 skipped.
    • dotnet format whitespace --verify-no-changes is clean on the changed files.
    • The analyzers report nothing new: the same CA1861 findings as on main under net8.0.
  • RealFixtureTests with that file as the only fixture:
    • Everything tree-related passes.
    • The .nwc-only theory has no data, as expected.
    • The OBJ and IFC exports of this model (tens of millions of triangles) run out of memory. They do the same on their own, independent of this change. I can open a separate issue if useful.

Merge Danger

Door: two-way. Reading only; no writer, API or package-shape change. Callers that caught NotSupportedException to retry with BuildSceneTree = false now simply get the tree.

Blast Radius: .nwd files with partition nodes.

  • The trailer layout comes from one family of files (Navisworks 2026, format version 448).
  • If your private .nwd fixtures come from other versions, the RealFixtureTests change will show quickly whether their trailers match.
  • If they don't, the reader fails with an InvalidDataException at the trailer instead of a NotSupportedException.

…y variants

- Class 32 (LcOaPartition) is a class-53 body behind one more string, with a
  trailer after its children that holds no objects; it is read for length.
  .nwd scene trees now open with BuildSceneTree on.
- A fragment without a pose sits at its class-93 centre c.
- The colour slot is optional in triangle and line records.
- One of the two quantised UV bit widths may be 0.
@mahach666
mahach666 merged commit ee20d28 into IOExtend:main Nov 17, 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.

Navisworks 2026 .nwd: partition node layout (class 32), fragments without a pose, and three geometry-record variants

2 participants