Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewer.getMergedRegion doesn't merge all regions in all models #386

Open
yogster opened this issue Apr 12, 2022 · 0 comments
Open

Viewer.getMergedRegion doesn't merge all regions in all models #386

yogster opened this issue Apr 12, 2022 · 0 comments
Assignees

Comments

@yogster
Copy link

yogster commented Apr 12, 2022

Expected behavior:

Viewer.getMergedRegion should merge all regions in all models

Actual behavior or exception details:

Viewer.getMergedRegion merges the most populated region of each model

This is because ModuleHandle.InitRegions only takes the most populated region of a geometry and discards the rest.

This means it's hard to find the bounds to use when clipping if there is more than one region in the model.
Also, on loading the IFC the camera points to the centre of the most populated region, instead of the centre of the model(s).

Version of the xBIM Viewer:

Latest (code in current master branch)

Minimal code (or steps) to reproduce the issue:

const viewer = new Viewer('canvasElementId');
viewer.on('loaded', function() {
    console.log(viewer.getMergedRegion());
});
viewer.load(fileUrl);

/*
Returns:
{
     population: 22,
     centre: [ 62640, 3100, 1747.5],
     bbox: [ 59900, -80, -5.000010013580322, 5480, 6360, 3505 ]
}

Should return:
{
     population: 110,
     centre: [ 2640, 3100, 1747.5],
     bbox: [ -60100, -80, -5.000010013580322, 125480, 6360, 3505 ]
}
*/

Minimal file to reproduce the issue:

20200205Model_PNO.ifc.zip

(from Open IFC Model Repository)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants