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
609 stars 185 forks source link

[Bug]: Can not display Alignments #878

Closed BIMengineer1 closed 2 months ago

BIMengineer1 commented 3 months ago

What happened?

I tried many IFC files with Alignments but the library fails to display them. The civil release has been around for some time (I suppose the library should at least read Alignments correctly), so it's not clear to me why it is not working. Thanks!

Version

Last version

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Anything else?

image

beachtom commented 3 months ago

Do you have an example file? It does work in many cases so we need to see what is different? Also the code you are using to pull out the alignments would be good

BIMengineer1 commented 3 months ago

@beachtom I tried every template that loads the files, and the model properties are all the same for every load (empty arrays of curves). This one for example https://docs.thatopen.com/Tutorials/Components/Front/Civil3DNavigator , but the result is the same for other templates too. IFC.zip

BIMengineer1 commented 3 months ago

@beachtom I tried every template that loads the files, and the model properties are all the same for every load (empty arrays of curves). This one for example https://docs.thatopen.com/Tutorials/Components/Front/Civil3DNavigator , but the result is the same for other templates too. IFC.zip

testIFC.zip

beachtom commented 2 months ago

So that representation of an Alignment is not like I would expect to see. I can't find a clear link between the IFCAlignment in the file and the IFCAlignmentSegments - do you have any other files?

BIMengineer1 commented 2 months ago

I used the default IFC export for 4x3 and 4x1 from Civil 3D. Basically my files have all the same structure. What software did you use to export the IFC alignments?

BIMengineer1 commented 2 months ago

image This is the xml structure of the last file.

BIMengineer1 commented 2 months ago

myIFC4X3_ADD1.zip This one from Trimble also. I don't understand what structure does the library expect to read the alignments. Does it work with your custom made IFC from the tutorials only?

beachtom commented 2 months ago

So often in the IFC there are multiple ways to represent the same thing. It seems we have only dealt with one of the ways. I need to investigate the model some more and look at how it is different

QuimMoya commented 2 months ago

Hello The provided files use different IFC formats, the first one uses 4X1 while the other uses 4X3_ADD2

To provide support for alignments in 4X1 we have to read a completely different structure, which we did at some point but deprecated with new versions. We can just add it again but it requires sometime as we have to read different elements and a different structure

Anyway we prioritize providing support for latest versions like 4X3_ADD2. This version uses IFCRELNESTS in spite of IFCRELAGGREGATES to connect IFCALIGNMENT with IFCALIGNMENTHORIZONTAL. We were using IFCRELAGGREGATES but we adapted it to read IFCRELNESTS too, so now it should read the alignments of the second model.

BIMengineer1 commented 2 months ago

@QuimMoya Thanks a lot for your work! Will this fix be available with the next release or I can try it now?

QuimMoya commented 2 months ago

Probably you have to wait until next release. Anyway you can test it using the demo viewer https://thatopen.github.io/engine_web-ifc/demo/

By pressing f12 you will see info about alignments

image