Please excuse any awkward or unclear phrasing, as I’m using a translation tool…
Objective
We are planning to implement a feature that allows loading objects outside the current Speckle Viewer context by using spatial inputs such as room objects, bounding boxes, or point-based extents.
More specifically, we want to retrieve objects based on:
coordinate ranges (e.g. XYZ extents),
or spatial relationships (e.g. intersection / containment with a given object or volume).
Question / Issue
Does the Speckle Viewer or Speckle Server API provide any built-in functionality to:
query or retrieve objects by coordinate range,
perform spatial joins between objects (e.g. get all elements intersecting a room or bounding box),
or load only objects that intersect a given spatial volume?
At the moment, it seems that object retrieval is primarily ID-based or hierarchy-based, rather than spatially queryable.
Proposed Approach
One possible approach we are considering is:
computing and storing AABB (axis-aligned bounding box) metadata for each object at import time,
persisting those AABB values in the database,
and using them for spatial filtering during query requests before loading data into the viewer.
Before going down this path, we would like to understand:
whether similar functionality already exists in Speckle,
or whether this approach aligns with Speckle’s intended architecture.
Context / Use Case
Our use case involves large models where loading all objects into the viewer upfront is not desirable.
We want to dynamically load only spatially relevant subsets of data based on user-selected spatial inputs.
Speckle Link
(Not yet available — this is currently a design / architecture question.)
Environment
- Speckle Viewer (Web)
- Custom backend / database integration
Thanks for your help.