xBimTeam / XbimWebUI

Web components for xBIM Toolkit
http://xbimteam.github.io/XbimWebUI/
Other
195 stars 120 forks source link

Handling Composite Elements #439

Open untecnologo opened 9 months ago

untecnologo commented 9 months ago

Hello, I have a question regarding composite elements. In the IFC file I have a Roof. This roof is made up of two slabs For example: 350 IfcSlab 351 IfcSlab 352 IfcRoof (350, 351) In the backend in the process I read the data of the roof. I set my roof as 352.

Once I implement the viewer and I select 352 the complete roof is not colored or selected because the roof is not there, what is present in the model is the slabs.

Do you have any recommendation to handle better those cases.

Also I would like to know the level of IfcRel Aggregates we should work or the plugin uses.

Thank you for your kind support.

andyward commented 9 months ago

This kind of aggregate relationship data is not held in the wexbim format - it's deliberately lightweight. There's nothing built into the WebUI to do this, so you need to go back to your origin model (presumably in some cloud services/API), to determine these relationships.

If you're building a spatial breakdown structure client-side already it's typically just a matter of expanding the IfcRelAggregates relationships below IfcProducts - Similar to how you may create the spatial hierarchy. As you probably know top level products are then associated with a containing spatial element using IfcRelContainedInSpatialStructure

So you might build a hypothetical tree structure like this - which may be used by the UI, but can also help the viewer selection:

When you select any level in the tree you can also select all descendants in the viewer.

Often you'd build these tree structures dynamically / lazily as an optimisation so you're not send the full tree to the browser.