Dion Moult 7f87408b78 bonsaiviewer: rework add-models false-origin guess + drop fly-mode input lag
Two independent threads that landed on this branch.

## 1. Federation false-origin guess: arm-on-add + frame-on-origin

The cc54237f5 fix moved the guess off the refresh() fan-in (terminating
the stack-overflow recursion on Holter Tower), but the gating was still
`modelIds().size() == 1` — broken for batch-add-into-empty-session
because the session registry is populated synchronously by all
addModel calls before any modelGeometryReady lands. Result: load 3
files at once → none of the per-model geometry-ready events ever
finds `size() == 1` → guess never fires → camera + federation origin
stay at surveyor coords.

Rework:

* **Arm/consume at the command boundary.** modules/models/Commands
  exposes `armFederatedFalseOriginGuess` / `consumeFederatedFalseOrigin
  Guess` (function pair — arming is a one-shot, raw-bool would let a
  peek-without-clear silently break the contract). `addModel` and the
  cloud-callback in `addModelFromCloud` arm if `modelIds().isEmpty()`
  at the moment they're about to register federation entries. The
  first geometry-ready then consumes the arm and runs the guess —
  batch add or single, works the same way.

* **Lazy first geometry point from mesh AABB centre.** Drop
  SceneLoader's `firstPlacement(mid)` / `first_placement` /
  `has_first_placement` and the two capture sites entirely. The
  viewport keeps CPU-side MeshInfo + InstanceCpu for picking /
  measurement; compute the anchor on demand via new const accessor
  `WgpuViewportWindow::firstGeometryPointWorldM(mid, out)` =
  instance0.placement × meshes[instance0.mesh_id].aabb_centre.
  This is more representative than the placement translation
  (placements often live far from the actual geometry due to long
  ObjectPlacement chains / intermediate local frames), and lighter
  storage-wise (lazy, vs. 128 B per model held just-in-case).

* **`guessFederatedFalseOrigin` math signature: Matrix4d → Vector3d.**
  The function only ever consumed `.block<3,1>(0,3)`; the Matrix4d
  API surface was a strictly-larger-than-necessary contract. Vector3d
  matches what the function actually needs.

* **`WgpuViewportWindow::frameOnFederatedOrigin(mid, max_distance_m)`**
  replaces the post-shift use of viewAll() that the ViewportView
  almost reached for. The federated false origin sits at (0,0,0) in
  post-shift space by construction, so the camera targets there
  directly; distance fits the model's post-shift AABB diagonal with
  viewAll's padding math, clamped to `max_distance_m` so a model
  with one crazy-coord outlier vertex can't pull the camera back so
  far the real geometry becomes a pixel. Called with 100 m cap from
  the guess. Unlike viewAll() this only iterates the one model the
  guess fired for — the "load 10 models, viewAll shows nothing"
  failure mode is structurally avoided.

* **ViewportView::tryGuessFirstModelFalseOrigin** renamed to
  `guessFederatedFalseOriginFromFirstModel` and the body restructured
  to consume the arm, look up the anchor via the viewport, mutate
  the federation origin (which propagates through SessionState's
  federatedFalseOriginChanged relay → refresh() → recompose all
  instance world AABBs), then `frameOnFederatedOrigin(mid, 100)`.

* **Internal guards preserved.** filePath skip (project files own
  the origin), current==defaults skip (don't clobber a user who
  set the origin manually then removed the model), placement /
  georef availability checks — defense-in-depth around the arm, not
  the primary gate. The arm-only flow means re-arming on add-into-
  empty-session is naturally re-firable: add → remove → add will
  retry if the previous guess returned defaults.

## 2. wgpu present-mode: prefer Immediate above FifoRelaxed

On Linux Vulkan stacks where the driver / compositor doesn't advertise
Mailbox (confirmed on the user's setup — capability log added in this
patch reports just `fifo, fifo_relaxed, immediate`), Fifo's 2–3 frame
queue doubles input-to-photon latency the moment WASD activates
(~16 ms render-body fully consumes the budget, so the queue is held
deep). On a 60 Hz display this reads as "less smooth than the 100 fps
HUD suggests" during fly-mode mouse-look-while-moving — confirmed by
WGPU_FLY_DEBUG dt traces (rock-solid 16-17 ms cadence, so it's not
frame pacing — it's latency).

Promote Immediate above FifoRelaxed in the preference order so that
when Mailbox is unavailable we pick the no-queue option (can tear
under fast motion, but tearing on architectural geometry is usually
invisible while the latency win is immediately felt). Also log the
full advertised capability list on first configure so future "why
isn't Mailbox available?" diagnostics don't need a code patch.

Mailbox remains first preference; Fifo remains the spec-guaranteed
final fallback.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 10:02:53 +10:00
2025-12-19 18:53:14 +05:00
2026-06-01 17:53:41 +10:00
2026-05-08 16:20:26 +02:00
2026-01-26 17:10:03 +05:00
2026-05-18 19:24:25 +02:00
2023-09-14 09:29:20 +02:00
2026-02-18 09:09:46 +11:00
2026-05-08 16:20:26 +02:00
2026-05-08 16:20:26 +02:00
2026-05-08 16:20:26 +02:00
2026-05-08 16:20:26 +02:00
2026-04-13 19:38:25 +05:00
2026-04-13 19:40:25 +05:00

IfcOpenShell

IfcOpenShell is an open source (LGPL) software library for working with Industry Foundation Classes (IFC). Complete parsing support is provided for IFC2x3 TC1, IFC4 Add2 TC1, IFC4x1, IFC4x2, and IFC4x3 Add2. Extensive geometric support is implemented for the IFC releases IFC2x3 TC1 and IFC4 Add2 TC1. Extending with support for arbitrary IFC schemas is possible at compile-time when using C++ and at run-time when using Python.

In addition to a C++ and Python API, IfcOpenShell comes with an ecosystem of tools, notably including IfcConvert (an application to convert IFC models to other formats), Bonsai (an add-on to Blender providing a graphical IFC authoring platform), and many other libraries, CLI apps, and more. Support is also provided for auxiliary standards such as BCF and IDS.

For more information, see:

Development is sponsored through your generous donations!

Open Collective Contributors

Contents

Name Description License Service
bcf Library to read and write BCF-XML and query OpenCDE BCF-API modules LGPL-3.0-or-later PyPI Anaconda-Server Badge
bonsai Add-on to Blender providing a graphical native IFC authoring platform GPL-3.0-or-later Official GitHub Unstable Chocolatey
bsdd Library to query the bSDD API LGPL-3.0-or-later PyPI
ifc2ca Utility to convert IFC structural analysis models to Code_Aster LGPL-3.0-or-later
ifc4d Convert to and from IFC and project management software LGPL-3.0-or-later PyPI
ifc5d Report and optimise cost information from IFC LGPL-3.0-or-later PyPI
ifcbimtester Wrapper for Gherkin based unit testing for IFC models LGPL-3.0-or-later
ifcblender Historic Blender IFC import add-on LGPL-3.0-or-later*
ifccityjson Convert CityJSON to IFC LGPL-3.0-or-later PyPI
ifcclash Clash detection library and CLI app LGPL-3.0-or-later PyPI
ifcconvert CLI app to convert IFC to many other formats LGPL-3.0-or-later* Official GitHub
ifccsv Library and CLI app to export and import schedules from IFC LGPL-3.0-or-later PyPI
ifcdiff Compare changes between IFC models LGPL-3.0-or-later PyPI
ifcedit CLI wrapper for ifcopenshell.api IFC model mutation functions LGPL-3.0-or-later PyPI
ifcfm Extract IFC data for FM handover requirements LGPL-3.0-or-later PyPI
ifcmax Historic extension for IFC support in 3DS Max LGPL-3.0-or-later* Official
ifcmcp MCP server for querying and editing IFC building models LGPL-3.0-or-later PyPI
ifcopenshell-python Python library for IFC manipulation LGPL-3.0-or-later* Official GitHub PyPI Anaconda Anaconda Docker AUR AUR Unstable Pyodide WASM Wheels tag
ifcpatch Utility to run pre-packaged scripts to manipulate IFCs LGPL-3.0-or-later PyPI
ifcquery CLI tool for querying and inspecting IFC building models LGPL-3.0-or-later PyPI
ifcsverchok Blender Add-on for visual node programming with IFC GPL-3.0-or-later GitHub
ifctester Library, CLI and webapp for IDS model auditing LGPL-3.0-or-later PyPI

The IfcOpenShell C++ codebase is split into multiple interal libraries:

Name Description License
ifcgeom Internal library for IfcOpenShell LGPL-3.0-or-later*
ifcgeom_schema_agnostic Internal library for IfcOpenShell LGPL-3.0-or-later*
ifcgeomserver Internal library for IfcOpenShell LGPL-3.0-or-later*
ifcjni Internal library for IfcOpenShell LGPL-3.0-or-later*
ifcparse Internal library for IfcOpenShell LGPL-3.0-or-later*
ifcwrap Internal library for IfcOpenShell LGPL-3.0-or-later*
qtviewer Internal library for IfcOpenShell LGPL-3.0-or-later*
serializers Internal library for IfcOpenShell LGPL-3.0-or-later*
S
Description
No description provided
Readme 507 MiB
Languages
C++ 57.4%
Python 36.2%
C 3.9%
Gherkin 0.7%
JavaScript 0.3%
Other 1.3%