Closed ostwalprasad closed 2 years ago
I ran into this today - the origin is meant to be at the centroid of the cube, but instead is at a corner.
Hi! IFC.js has an option called COORDINATE_TO_ORIGIN
, which moves the geometry of the file to the origin (ignoring the data within the IFC file) to prevent numerical stability issues if the file is very far away from the origin. At first we were using the IFC data to do this, but we found that the data was not correct in many cases. We decided to go for the solution that succeded in most use cases and pick a random triangle of the geometry as origin of transformation.
Of course, all data is available using IFC.js API, so that any dev can provide options to the user to federate multiple models. We store the transformation matrix used in each model, so that multiple models can be coordinated using it, and the real coordinates of any point in space can be infered. By disabling this option, the IFC will be located in its real position.
I'm closing this for now. If you have a specific problem with a file that you can't locate where you want, feel free to open another issue.
At first we were using the IFC data to do this, but we found that the data was not correct in many cases
Can you elaborate on this? I feel there is a better solution than universally moving the origin for every model. In Blender, we only create a false origin when the model is using map coordinates.
Using the data of the properties of IFC that describe the position of a model in space resulted in numerical stability issues in many cases. We found that optionally allowing users to just bring the geometry to the origin work in 100% of the use cases. This is not the only way to work with IFC.js: you can also query the data of the IFC to get its actual position. The library users often have little control of the IFCs they have to work with, so giving them an optional approach that always works (and even allows them to federate multiple models), regardless of the quality of the model, makes them happy. Users that want to use the IFC-defined origin also have the power to do so already.
But hey, if you'd like to propose an optional alternative approach, PRs are open! 🙂
Hello!👋
Thank you for the support on the discord channel, I'm opening this issue for the continuing discussion.
A lot of IFC files seem to be shifted from their origin as seen in the screenshots below. These example files are taken from https://github.com/IFCjs/test-ifc-files
The model itself looks alright, but when the coordinates are to be used/communicated with different systems like IfcOpenShell it becomes a bit difficult because the coordinates do not match.
The
COORDINATE_TO_ORIGIN
argument toapplyWebIfcConfig
also doesn't seem to have any effect.Links for the above files in screenshot: https://github.com/IFCjs/test-ifc-files/blob/main/Others/haus.ifc https://github.com/IFCjs/test-ifc-files/blob/main/Others/479l7.ifc https://github.com/IFCjs/test-ifc-files/blob/main/Revit/rst_advanced_sample_project.ifc