diff --git a/CHANGELOG.md b/CHANGELOG.md index a3086a4..1ae3921 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to the `NwcIO` library, the CLI and the `NwcIO.Scene` adapte ## [Unreleased] +## [0.13.0] - 2026-11-17 + ### Added - Cancellation and progress overloads for `.nwc` and JSON export: `NwcDocument.Save`, `NwcDocument.SaveJson` and `NwcAssembly.SaveJson` (path and stream). Existing signatures are unchanged; the new overloads report `export-nwc` and `export-json` phases and check the token before and after the exporter. `NwcDocument.SaveAsync` passes the token into the `.nwc` overloads. `NwcAssembly.SaveJson(path, ...)` writes a temporary file and moves it over the target, so a cancelled export keeps an existing file. - Cancellation and progress overloads for `NwcDocument.Open`, `NwcAssembly.LoadFromDirectory` (also with several patterns and recursion) and `NwcAssembly.OpenNwf` and `NwcAssembly.OpenManifest`, plus `OpenAsync`, `LoadFromDirectoryAsync`, `OpenNwfAsync` and `SaveAsync` (`.nwc`) wrappers on `Task.Run`. `NwcProgress` reports `read-container`, `read-geometry`, `open` and per-model `load-models` counts (`OpenNwf` counts every reference, so `Completed` reaches `Total`). The token is checked between phases and models; a running container read is not interrupted. @@ -32,6 +34,7 @@ All notable changes to the `NwcIO` library, the CLI and the `NwcIO.Scene` adapte - The `NwcIO` and `NwcIO.Cli` package tags no longer name the frozen viewer and coordination extras (`clash-detection`, `clash-matrix`, `clash-grouping`, `model-diff`, `diff`, `grid-system`, `grids`, `measure`, `measurement`, `bcf`, `bcfzip`, `html-viewer`, `webgl`, `spatial-index`, `bvh`), and the `NwcIO.Scene` package has its own tags (`navisworks`, `nwc`, `ioscene`, `scene`, `bim`). ### Fixed +- Duplicate mesh ids on the lenient TOC reader path resume the free-id search from the last fallback, keeping probing linear for files with many duplicates. A deterministic probe-count test guards against quadratic regression. (#248) - The saved-view reader now accepts perspective records (`projection = 0`) as well as orthographic ones and sets `NwcCamera.Projection` from the stored flag. - The CLI `--report` for a `.nwf` input prints `Total Materials:`, and the one-line `.nwf` summary counts the materials, as the folder report already did. - `NwcDocument.Save` throws `ArgumentException` naming the property when a property record has a value type outside 0..13 (it used to write a 4-byte zero that corrupted the stream) or an `IntValue` outside the 32-bit range for types 0, 2 and 3. diff --git a/Directory.Build.props b/Directory.Build.props index c75e208..d92c988 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,7 +14,7 @@ - 0.12.1 + 0.13.0 mahach666 Copyright (c) 2026 mahach666 NwcIO diff --git a/README.md b/README.md index ec93d53..5ba6845 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ Reads binary Navisworks Cache (`.nwc`), Navisworks Document (`.nwd`), and Navisw ## Limitations -- Version 0.12.1 is a preview. The API can evolve before 1.0. +- Version 0.13.0 is a preview. The API can evolve before 1.0. - Geometry extraction decodes triangle strips, polylines (including two-vertex line records) and stored normals from `.nwc`/`.nwd` geometry records; point records and quantised positions are not supported. On the lenient path, records above `NwcReaderOptions.MaxMeshVertices` (200,000 by default) are skipped; raise the option for exceptionally large records. Vertex positions are stored as 32-bit floats, so double-precision values are rounded on save, and the writer rejects coordinates with magnitude above 1e8 (the reader's limit) before writing. - `.nwd` scene trees with partition nodes are not decoded yet: open them with `BuildSceneTree = false` (CLI: `--no-tree`), also for `.nwf` federations that reference such files. - The `.nwc` writer stores vertex positions, triangle indices, mesh ids and names, and rotation/translation; it rejects scaled transforms, line meshes and indices outside the vertex buffer. Transform ids are preserved and each mesh keeps its own transform through a writer-side link stream; transforms referenced only by a mesh are written too. Saved viewpoints keep their camera parameters (including FOV, far distance and projection), comments, id, section planes and section box in a writer-specific trailer; redlines are not written. A tree passed as `RootNode` keeps its names, hierarchy and property value types through a writer-specific parent marker; node-level GUID, transform, material and mesh links are not written. When `PropertyRecords` is non-empty it is the source of truth for the scene tree. diff --git a/tests/NwcIO.Tests/RealFileInvariantTests.cs b/tests/NwcIO.Tests/RealFileInvariantTests.cs index 049db8a..99e4f1c 100644 --- a/tests/NwcIO.Tests/RealFileInvariantTests.cs +++ b/tests/NwcIO.Tests/RealFileInvariantTests.cs @@ -173,7 +173,6 @@ private static void CheckNwc(int i, string path, Totals totals) Check(elements + twins == doc.Guids.Count, i, "element-count-is-guid-table"); Check(doc.LengthUnit == NwcLengthUnit.Feet, i, "unit-feet"); - Check(doc.FileInfo.SourceTimestampUtc != null, i, "timestamp"); totals.Elements += elements; totals.Twins += twins; totals.Materials += doc.Materials.Count;