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

IFCLoader: Geometry optimization, select, hide and property fetch #21905

Merged
merged 1 commit into from
Jun 2, 2021
Merged

IFCLoader: Geometry optimization, select, hide and property fetch #21905

merged 1 commit into from
Jun 2, 2021

Conversation

agviegas
Copy link
Contributor

@agviegas agviegas commented May 27, 2021

This PR is one of the big ones. From now on, any user can create a complete IFC viewer using the IFCLoader:

  • Geometry optimization: IFC files can contain hundreds or thousands of objects, and this caused larger scenes to have lag in the previous implementation. It is now possible to load scenes of hundreds of megabytes at 60 fps. This optimization is achieved by mixing all the meshes into one. Obviously, this makes accessing the individual objects more difficult; for that reason we have implemented additional methods that allow the user to continue working with those individual objects, even if they have been merged. This methods include:

  • Object highlight: where the user can choose the highlight material.

  • Object hiding: using shaders.

  • Object property selection: finally, we are able to get the metadata of the IFC and all its information (materials, construction characteristics, price, etc).

  • IFC spatial structure tree retrieval: users can easily get all the tree of entities of objects in the scene to create visual menus that show, for example, how many floors the building has, which objects belong to each floor, etc.

@mrdoob mrdoob added this to the r130 milestone Jun 2, 2021
@mrdoob mrdoob merged commit da76e12 into mrdoob:dev Jun 2, 2021
@mrdoob
Copy link
Owner

mrdoob commented Jun 2, 2021

Thanks!

@joshuaellis joshuaellis mentioned this pull request Jun 13, 2021
5 tasks
@mrdoob
Copy link
Owner

mrdoob commented Jul 2, 2021

@agviegas What do you think about adding a IFCScene (extends Scene) class inside IFCLoader.js?

I think these methods would be more fitting in a IFCScene class and IFCLoader's parse could return a IFCScene.

@agviegas
Copy link
Contributor Author

agviegas commented Jul 2, 2021

We can do it, but we handle all IFC models centrally 🤔 if the IFCLoader returns an IFCScene, how would it look like for multiple IFC models? Having multiple models (one for architecture, other for structure, other for HVAC, etc) is the commonest use case.

@mrdoob
Copy link
Owner

mrdoob commented Jul 2, 2021

You mean that the developer uses a single IFCLoader to load multiple files and then they manipulate all these files via that single loader?

@agviegas
Copy link
Contributor Author

agviegas commented Jul 2, 2021

Yes, because when you instantiate the IFC Loader, you are also instantiating the WASM parser, which occupies some space in memory and needs some time to initialize. The idea was to use the Loader as an API to interact with the models (e. g. access individual objects of the IFC or their metadata). In BIM there are several operations where the IFC models are closely coupled, and this is the reason behind centralizing everything in the IFCLoader instance. The library works like a database in memory, and having it all toguether helps us manage everything more efficiently. But maybe there is another way of doing this! 🙂

@mrdoob
Copy link
Owner

mrdoob commented Jul 2, 2021

Maybe adding a reference to the wasm library in the IFCScene class?

@agviegas
Copy link
Contributor Author

agviegas commented Jul 2, 2021

Ok, sounds good! Where would the IFCScene class be? In the same file? Just to be clear, the user would have a different IFCScene for each model (even if they belong to the same building), right?

@agviegas
Copy link
Contributor Author

agviegas commented Jul 2, 2021

Btw we were actually planning to update the IFCLoader and the types this weekend, so we can include this right away.

@mrdoob
Copy link
Owner

mrdoob commented Jul 2, 2021

Ok, sounds good! Where would the IFCScene class be? In the same file?

Yep!

Just to be clear, the user would have a different IFCScene for each model (even if they belong to the same building), right?

It could also be a IFCModel (that extends THREE.Group). It just seems more intuitive to me to have these methods in the actual "data" than in the loader.

Btw we were actually planning to update the IFCLoader and the types this weekend, so we can include this right away.

That'd be great!

@agviegas
Copy link
Contributor Author

agviegas commented Jul 2, 2021

Actually the term IFCModel makes more sense and is more coherent with the IFC domain. Can we use it instead of IFCScene?

@mrdoob
Copy link
Owner

mrdoob commented Jul 2, 2021

Yeah, IFCModel extends THREE.Group.

@agviegas
Copy link
Contributor Author

agviegas commented Jul 3, 2021

How does this look @mrdoob? mesh is the IFC.Mesh, and ifc gives access to all the functionality to interact with the IFC file. Here you can see the IFCModel being returned.

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

Successfully merging this pull request may close these issues.

None yet

2 participants