Picking individual geometry representation items #2985
Replies: 2 comments
|
Thanks, and this is exactly the kind of request I want landing here. The mapping you are looking for already exists inside the pipeline. It is one field short of reaching you. That is a value we compute and throw away at the wasm boundary, not something that has to be derived back out of triangles. Where the id already isThe router walks // rust/geometry/src/router/processing.rs
sub_meshes.add(item.id, mesh);That survives into the per-element Then What I am building
If you render the meshes yourself, that alone is enough: one mesh per piece, indexed however you like. On top of that, opt-in item resolution on // packages/renderer/src/picker.ts
const mesh = meshes[decoded.meshIndexPlusOne - 1];
return { expressId: mesh.expressId, ... }; // the piece is right thereFor the jump to source you need nothing new from me. The item id is the STEP id, so Limitations, so you know what a null meansA null will mean "merged away", not "no such item":
One thing your question turned up that is a bug, not a gap. For material-layered walls and slabs the pipeline reuses the same field to carry the layer's // rust/geometry/src/router/layers.rs
out.sub_meshes.push(SubMesh::new(layer.material_id, slab));So On #2443: your read is right. That one was about a viewer-side registry keeping only the last submesh per element and it was closed by #2452. It did not touch per-item identity. One question backDoes per-piece granularity cover you, or do you need per-triangle? IfcOpenShell exposes |
|
Thank you so much for the detailed reply! That's amazing and essentially the exact feature I would need. Being able to retrieve the representation item's STEP ID would cover my use case entirely. Per-piece granularity is sufficient for me, I currently do not need per-triangle IDs or picking. GPU-instanced occurrences do matter for me, though. Repeated windows, doors, frames, and similar products are likely to benefit most from instancing, while also being the elements where drilling into individual parts is especially useful (please correct me if I have the wrong mental model of instancing here). If carrying the item ID through the instanced wire format is feasible, that would complete the feature for my use case. If not, I can always disable GPU instancing. Apart from that limitation, what you are building would completely address my request! I do have one related question out of curiosity: could the current design also expose entities referenced by a representation item? For example, an Thank you again! |
Uh oh!
There was an error while loading. Please reload this page.
Hi! First of all, I really love the project. I have been experimenting with using ifc-lite as a faster alternative to web-ifc and the ThatOpen ecosystem for the 3D preview in my VS Code IFC extension.
The general approach works very well and loading, hiding/isolating and picking elements is extremely fast. There is one feature, however, from my existing web-ifc viewer that I have not been able to reproduce with ifc-lite: drilling down into the individual geometry parts of a building element.
For example, when looking at a wall context, I want picking any part of a window to resolve to the owning
IfcWindow. After focusing the window itself, however, I would like to be able to pick its individual representation items (for example a pane, frame part,IfcFacetedBrep,IfcExtrudedAreaSolid, or another source-backed geometry item) and navigate to that entity in the IFC source.As far as I can tell, ifc-lite picking currently returns the express ID of the owning product for all of these parts. I could not find a public mapping from the rendered triangles or submeshes back to their originating representation-item IDs.
Is exposing this level of picking granularity something that is already planned or would fit the direction of the project? For my use case, either of these would probably be sufficient.
I found #2443, which discusses multiple MeshData entries per product, but as far as I understand it still treats those entries as parts of the same product-level identity. My question is specifically about retaining or exposing the originating IFC representation-item ID for each part.
I understand that this may not always be straightforward, but was wondering if that is something you already thought about or think would be possible to implement.
Thanks again for an awesome project!
All reactions