web-ifc-three icon indicating copy to clipboard operation
web-ifc-three copied to clipboard

COORDINATE_TO_ORIGIN setting with multiple geolocated files

Open ericpasquiet opened this issue 3 years ago • 1 comments

Hello,

I need to load multiple IFC files that are geolocated. Each of these IFC file represent parts of a same building. I cannot merge all these files into one : these are customer data, and they have to remain as is. When loading all the files together with web-ifc-three, they superpose nicely to make up the whole building.

However, I get distorted geometry for small details because of the geolocation. To solve this, I need to use the COORDINATE_TO_ORIGIN setting.

The problem is that when loading each file with the COORDINATE_TO_ORIGIN, they do not end up exactly at the right place : they are shifted a few meters away from each other. I guess this is because the "re-centering" performed at the load of each model is done around a point computed as some kind of average of all the coordinates found in the file (but that's just an assumption of mine), and that average is not exactly the same for each file.

Do I have any workaround to that issue?

ericpasquiet avatar May 23 '22 16:05 ericpasquiet

Looking at the examples provided, I was able to find a solution to my issue, but using a non-documented API. I do a "COORDINATE_TO_ORIGIN = true" on the load of my first model, and when loading the next models, I fiddle with the coordination matrix :

const matrixArr = await rendering.ifcLoader.ifcManager.ifcAPI.GetCoordinationMatrix(newModel.modelID);
const matrix = new THREE.Matrix4().fromArray(matrixArr);
rendering.ifcLoader.ifcManager.setupCoordinationMatrix(matrix);

This way, all models are correctly centered with each other.

However, I have found no documentation on these APIs I am using (GetCoordinationMatrix, setupCoordinationMatrix) : have I missed something, or are these APIs planned to become official?

ericpasquiet avatar Jun 10 '22 06:06 ericpasquiet

::take

aka-blackboots avatar Nov 28 '22 10:11 aka-blackboots

🟢🟢🟢

::take

Hi, @aka-blackboots! Thanks for taking this bounty! The due date is December 19, 2022 UTC.

If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bounty’s status will automatically changed to done.

If you do not need to make a PR, tell the manager @agviegas to run ::done command after your tasks is confirmed to be done.

Good luck!

agviegas avatar Nov 28 '22 10:11 agviegas

::drop

aka-blackboots avatar Nov 28 '22 10:11 aka-blackboots

🟢🟢🟢

::drop

Hi, @aka-blackboots! Thanks for giving it a try! It’s now once again available for anyone to take.

agviegas avatar Nov 28 '22 10:11 agviegas

Hey, you can load the first model using COORDINATE_TO_ORIGIN=true, and then apply that matrix to the rest of the rest of the models. You can see an example of doing that in this function of web-ifc-viewer. Let us know if you have any problems with it!

agviegas avatar Mar 25 '23 11:03 agviegas

@ericpasquiet, were you able to fix this issue?

aka-blackboots avatar Apr 24 '23 14:04 aka-blackboots

Hi, Yes, I was able to fix the issue, thank you.

ericpasquiet avatar Apr 24 '23 15:04 ericpasquiet

Great! closing this bounty as well!

aka-blackboots avatar Apr 24 '23 15:04 aka-blackboots