ThatOpen / engine_web-ifc

Reading and writing IFC files with Javascript, at native speeds.
https://thatopen.github.io/engine_web-ifc/demo
Mozilla Public License 2.0
617 stars 190 forks source link

[Bug]: IfcBooleanResult not rendering properly (Working on 0.0.35) #452

Closed nickcastel50 closed 1 year ago

nickcastel50 commented 1 year ago

What happened?

Hello, it seems some boolean results aren't rendering properly in recent versions of web-ifc.

With the following file: https://github.com/Swiss-Property-AG/Momentum-Public/blob/main/Momentum.ifc I am getting invalid geometry on the resulting mesh.

I have tried it against the demo on https://ifcjs.github.io/web-ifc/demo/ and get the following:

image

image

Note, we are using an older version of web-ifc (0.0.35) here and do not notice the issue: https://bldrs.ai/share/v/gh/Swiss-Property-AG/Momentum-Public/main/Momentum.ifc#c:-38.64,12.52,35.4,-5.29,0.94,0.86

I believe I have pinpointed the invalid geometry to the following boolean result chain:

#108674= IFCBOOLEANRESULT(.DIFFERENCE.,#108228,#108250);
#108675= IFCBOOLEANRESULT(.DIFFERENCE.,#108674,#108311);
#108676= IFCBOOLEANRESULT(.DIFFERENCE.,#108675,#108370);
#108677= IFCBOOLEANRESULT(.DIFFERENCE.,#108676,#108429);
#108678= IFCBOOLEANRESULT(.DIFFERENCE.,#108677,#108494);
#108679= IFCBOOLEANRESULT(.DIFFERENCE.,#108678,#108568);
#108680= IFCBOOLEANRESULT(.DIFFERENCE.,#108679,#108633);

Please let me know if you need any more information, I'd be happy to help!

Version

https://ifcjs.github.io/web-ifc/demo/

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Anything else?

No response

QuimMoya commented 1 year ago

image

Found a solution!

nickcastel50 commented 1 year ago

Found a solution!

Hi @QuimMoya, that's great! What was the solution?

QuimMoya commented 1 year ago

@nickcastel50

The problem was in the solid boolean functions. It failed because the wall was made using a composite profile. Then when this composite profile was extruded, it produced multiple coplanar solids. I just separated them.