From ca60efe0dd5b6a3cf5f360de2c0825923c9e5306 Mon Sep 17 00:00:00 2001 From: mahach666 <79989386+mahach666@users.noreply.github.com> Date: Wed, 2 Dec 2026 19:31:33 +0300 Subject: [PATCH 1/7] Show the family types of an .rfa page and switch between them An HTML page of a Revit family carries its types (ViewerDocument.FamilyTypes): their parameters, and for each type its meshes or the reason it has none. With two or more types the viewer opens a Family type panel; choosing a type shows its geometry and parameters, and selection, measurement, sections and fitting see the chosen type only. Viewer JSON, .ivmesh and --add outputs keep the saved type only and the CLI says so. On such a page the vertex positions are written as float32 instead of on the 1/1024 m grid, which moved a vertex by up to half a millimetre, and each material is drawn slightly nearer than the one before it. Faces of two parts that coincide (a flange bore on the ring it sits on) no longer alternate between the two parts per pixel. Other pages are written and drawn as before. --- CHANGELOG.md | 15 + README.md | 2 + docs/public-api.md | 6 + src/IOViewer.Cli/FamilyMap.cs | 35 ++ src/IOViewer.Cli/Program.cs | 25 +- src/IOViewer.Cli/SceneFederation.cs | 2 + src/IOViewer/Exporters/HtmlViewerOptions.cs | 3 +- src/IOViewer/Exporters/JsonViewerExporter.cs | 4 + src/IOViewer/Exporters/ViewerPayloadWriter.cs | 164 +++++-- src/IOViewer/Model/ViewerDocument.cs | 7 + src/IOViewer/Model/ViewerFamilyTypes.cs | 49 +++ src/IOViewer/Viewer/dist/viewer.js | 378 ++++++++-------- src/IOViewer/Viewer/src/data.js | 17 + src/IOViewer/Viewer/src/engine/modelScene.js | 29 +- src/IOViewer/Viewer/src/i18n.js | 30 ++ src/IOViewer/Viewer/src/main.js | 14 + src/IOViewer/Viewer/src/tools/sections.js | 12 + src/IOViewer/Viewer/src/ui/app.js | 11 +- .../Viewer/src/ui/familyTypesPanel.js | 64 +++ src/IOViewer/Viewer/src/ui/icons.js | 3 +- src/IOViewer/Viewer/src/ui/properties.js | 11 +- src/IOViewer/Viewer/src/ui/shell.js | 2 +- src/IOViewer/Viewer/src/ui/statusBar.js | 12 +- src/IOViewer/Viewer/styles/viewer.css | 37 +- .../Viewer/test/e2e/family-types.spec.js | 244 +++++++++++ src/IOViewer/Viewer/test/e2e/global-setup.js | 34 +- src/IOViewer/Viewer/test/unit/data.test.js | 35 ++ .../Viewer/test/unit/modelScene.test.js | 70 ++- tests/IOViewer.Tests/CliTests.cs | 2 +- tests/IOViewer.Tests/FamilyTests.cs | 405 ++++++++++++++++++ 30 files changed, 1479 insertions(+), 243 deletions(-) create mode 100644 src/IOViewer.Cli/FamilyMap.cs create mode 100644 src/IOViewer/Model/ViewerFamilyTypes.cs create mode 100644 src/IOViewer/Viewer/src/ui/familyTypesPanel.js create mode 100644 src/IOViewer/Viewer/test/e2e/family-types.spec.js create mode 100644 tests/IOViewer.Tests/FamilyTests.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index e72c82b..a22311c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,21 @@ API between minor releases. ## [Unreleased] +### Added + +- The CLI opens Revit families (`.rfa`) through `RvtIO.Scene`. When some of a family's geometry cannot be read, it + prints `Warning: Family geometry is incomplete.` and the HTML page shows an **Incomplete geometry** banner. Viewer + JSON keeps the mark in `ViewerDocument.GeometryIncomplete`. +- An HTML page of a family carries its types (`ViewerDocument.FamilyTypes`): their parameters, and for each type its + meshes or the reason it has none. Viewer JSON, `.ivmesh` and `--add` outputs keep the saved type only, and the CLI + prints `Warning: Family types are not carried to this output.` +- With two or more types, the viewer opens a **Family type** panel. Choosing a type shows its geometry and parameters, + or says why it has no geometry; selection, measurement, sections and fitting see the chosen type only. +- On a page with family types, the vertex positions are written as float32 instead of on the 1/1024 m grid (which moved a + vertex by up to half a millimetre), and each material is drawn slightly nearer than the one before it, so that + faces of two parts that coincide (a flange bore on the ring it sits on) no longer alternate between the two per + pixel. The later material shows on a shared face. Other pages are written and drawn as before. + ## [0.4.2] - 2026-11-27 ### Changed diff --git a/README.md b/README.md index b781cd9..2e2e5ec 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ ioviewer model.obj -o viewer.html # Convert IFC, Revit or Navisworks models via the scene adapters ioviewer model.ifc ioviewer model.rvt -o viewer.html +ioviewer family.rfa -o family.html ioviewer model.nwc -o viewer.html # Convert and immediately preview in default web browser via built-in HTTP server @@ -226,6 +227,7 @@ The documentation site with API references and guides is at