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
581 stars 172 forks source link

Define the origin of the model as being the origin of one site #84

Open favreau84 opened 2 years ago

favreau84 commented 2 years ago

Context

-When the site origin is far far away from the world origin, some discrepancies appear in the 3D geometry (example : https://github.com/IFCjs/web-ifc-three/issues/30). -Thanks to the COORDINATE_TO_ORIGIN:true config, a new model's origin is computed (let's call it IFCjs origin), the model is loaded in Three.js with the origin positioned at (0,0,0), and the discrepancies disappeared.

Problems

Problem 1

Problem 2

Possible solution to solve 1 & 2

Solving Problem 1

Capture d’écran 2021-09-20 à 11 54 59

Solving Problem 2

=> Solution

Capture d’écran 2021-09-20 à 12 01 26
agviegas commented 2 years ago

What do you think @tomvandig?

tomvandig commented 2 years ago

How would you propose we choose the site? We can give the user the option to scan the sites beforehand and determine the coordination they want, but this is possible already now, although not easy.

Do you propose that this process should be easier, i.e: get its own API endpoint?

favreau84 commented 2 years ago

Hi @tomvandig, as far as I'm concerned, in the vast majority of the ifc files used in a construction project, there is only one ifcSite. So taking the first (and only one) site will definitely solve 99% of the use cases. For the edge cases were there are several ifcSites, well, it's not really a pb : the user will be able to translate the model afterwards from the ifcSite locationPlacement.

In other words, we could have 2 options (already implemented) + 1 additional option to load the model :

Please keep in mind that I'm looking for a programmatic solution to avoid the manual settings of the ifcSite coordinates to 0,0,0 that do solve geometry discrepancies in the model I'm using.

What do you think ?

tomvandig commented 2 years ago

@favreau84

Sounds good, I'll update the ticket when first_site_as_origin (or similar) is in

loicroybon commented 2 years ago

Hello, I opened this issue which seems quite close : https://github.com/tomvandig/web-ifc/issues/91

autra commented 1 year ago

As a side note, it would be really useful if ifc.js would store the chosen offset somewhere in the generated mesh, for instance on .userData.originOffset.

agviegas commented 11 months ago

@autra In the new components repository, we import IFCs as a group of meshes called FragmentsGroup that has a property with the applied matrix 🙂

sguimmara commented 8 months ago

@autra In the new components repository, we import IFCs as a group of meshes called FragmentsGroup that has a property with the applied matrix 🙂

What is the name of this property ?

agviegas commented 8 months ago

@sguimmara it's coordinationMatrix. You can check it out in the flatbuffer schema here!