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

ifcapi.OpenModel seems to ignore config with COORDINATE_TO_ORIGIN:true #151

Closed MrGaribaldi closed 2 years ago

MrGaribaldi commented 2 years ago

I'm trying to combine different IFC-models with other data sources, and so need to get the coordination matrix for the models. Using the online version here https://ifcjs.github.io/web-ifc-viewer/example/index and it will extract the matrix as expected. But I can't replicate the behavior with web-ifc, using b61bc028a4773f7bd6c23e73f6a5c2daf50cbe51

Changing line https://github.com/tomvandig/web-ifc/blob/b61bc028a4773f7bd6c23e73f6a5c2daf50cbe51/examples/nodejs/index.js#L16 to the following:

let modelID = ifcapi.OpenModel(ifcData, {COORDINATE_TO_ORIGIN:true, USE_FAST_BOOLS:true});
let coordMatrix = ifcapi.GetCoordinationMatrix(modelID);

I'd expect to get a matching coordination matrix as the web-viewer, but it stays identity. Tested with the Wellness Centre Sama model from http://openifcmodel.cs.auckland.ac.nz/

agviegas commented 2 years ago

Hi @MrGaribaldi ! If I understood you correctly, you say that it works in web-ifc-viewer but not in web-ifc, right?

As you might know, this library has 3 layers. From outside to inside: web-ifc-viewer, web-ifc-three and web-ifc. You should be able to reproduce it if you see what we did in web-ifc-viewer and web-ifc-three.

This is how we are implementing it. If you can't make it on your end, let us know and we'll happily guide you. Cheers!