xeokit-sdk icon indicating copy to clipboard operation
xeokit-sdk copied to clipboard

storeyViewPlugin images display too much or not enough objects

Open perssam42 opened this issue 1 year ago • 6 comments

Hello !

I use the storeyViewPlugin to display my model's Storeys and i added the planPointer to help users know where they are when using this feature.

The issue here is that images generated by createStoreyMap() are not accurate : it often displays too much objects. I already tried to display only one storey with

storeyViewsPlugin.showStoreyObjects(storeyMap.storeyId, { hideOthers: true });

before generating each Storey image to help the generator but it does not work.

I also noticed that in most model when i create my storeyMap from roof to first floor, storeys image are shifted by 1 storey : -first storey image contains only few objects -second storey image contains the roof which should have been the first storey

  • third storey image is the top floor
  • etc.. And in some case the first storey make the viewer crash because it's not a valid selector but i guess it's just a consequence of the bug

Capture d'écran 2024-03-05 175555 Capture d'écran 2024-03-05 175724 Capture d'écran 2024-03-06 095829

To Reproduce Execute the buildStoreyMapsMenu() function with planPointer implementation. (mine is very close to xeokit examples one)

Expected behavior I expect generated storey images to display only the rights objects (those in the actual storey) and not the roof when not needed or any object outside the giving storey.

**Desktop **:

  • OS: Windows
  • Browser : chrome

Thx for your help Regards

Sam

perssam42 avatar Mar 06 '24 09:03 perssam42

Hi,

StoreViewsPlugin depends on the IFC organizing the objects correctly within IfcBuildingStorey elements.

It works by iterating downwards through the element hierarchy, to create a storey view for each IfcBuildingStorey, that contains the elements within the subtree rooted by the IfcBuildingStorey.

Unfortunately sometimes the IFC is authored so that this containment is not done correctly, and sometimes will overlap between the storeys (eg stairwells).

A quick way to verify this containment is to view the model using a TreeViewPlugin set to "containment" hierarchy mode, then exclusively enable the checkboxes for each of the stories to see if the elements are contained, overlap etc. The IfcBuildingStoreis are the fourth level down in the tree.

In the case of Schependomlaan test model, we have a correct containment:

Screenshot from 2024-03-06 11-01-17

Try that first, and let's see if your storey's are authored OK, then we can take it from there.

I suppose we could make the StoreyViewsPlugin automatically trim the elements at the top and bottom of each storey as it creates each storey view image, however I'm not sure if that would create a true enough image.

xeolabs avatar Mar 06 '24 10:03 xeolabs

Thanks for your quick answer !

My building model is not perfect but it's quite well configured tho. Capture d'écran 2024-03-06 111304 Capture d'écran 2024-03-05 175555

As you can see "BAT A TOITURE" supposed to be the first storey displaying a roof displays only guardrails (almost invisible in image) and "BAT A R+4" displays the roof but it's supposed to be an apartment (c.f. my first message screenshots)

I already tested this with Schependomlaan and i saw the same issue :

Capture d'écran 2024-03-06 113034 Capture d'écran 2024-03-06 113122 Capture d'écran 2024-03-06 112801

"04 dak" displays only few objects, and "03 derde verdieping" displays the expected image for 04 dak.

For "-1 fundering" it displays too much objects and not only the fundering border like in the real storey.

I might have done something wrong in my code to obtain such a result but i really don't know what it can be.

Regards

Sam

perssam42 avatar Mar 06 '24 11:03 perssam42

When isolating each story in the tree view, do you see only the expected objects?

Also, if you can share your model publicly, we can add it to our test suite.

xeolabs avatar Mar 06 '24 11:03 xeolabs

When i isolate storeys in the tree view it shows only expected objects yes.

Unfortunatly i can't share this model because its owned by a client. However here is the Schependomlaan xkt i used for the example.

geometry.zip

I noticed it's often IfcSlab that are shifted, maybe it can help.

perssam42 avatar Mar 06 '24 13:03 perssam42

I noticed it's often IfcSlab that are shifted, maybe it can help.

Got it - which converter tools are you using?

Also, if you're one of our enterprise users, could you please log this issue with our Jira, then we can track this one there as well.

xeolabs avatar Mar 06 '24 14:03 xeolabs

Most of the time I use xeokit-convert version 1.1.15-beta-1. But for the Schependomlaan model i just sent, it's the geometry.xkt already converted i found in the examples.

I'm not one of your entreprise users, I planned to do this project using the Open Source way so I guess I can't get access to your Jira.

perssam42 avatar Mar 06 '24 15:03 perssam42

Could you try using the pipeline tools described here: https://www.notion.so/xeokit/Converting-IFC-Models-to-XKT-using-Open-Source-Tools-A-Simpler-Pipeline-02d45ba457eb4f808f63bcacb71a4fb3

The convert2xkt direct IFC->XKT conversion mode uses web-ifc internally, which may not be processing the IFC properly in this case, I'm not sure.

xeolabs avatar Mar 11 '24 10:03 xeolabs