engine_components icon indicating copy to clipboard operation
engine_components copied to clipboard

Make fragments more scalable with tiles

Open agviegas opened this issue 2 years ago • 2 comments

Description 📝

Currently, geometries are generated as a single binary file created with flatbuffers. This has the downside that the whole model data is handled as a whole and therefore consumes a lot of memory and has limitations such as:

  • Makes it impossible to convert bigger IFC files to fragments.
  • Makes it impossible to load bigger IFC files in more modest devices.

Suggested solution 💡

Some time ago, we implemented a POC for "BIM tiles", allowing to lazily load only items that were visible for the user. This is a deep rabbit hole, and an ideal solution would involved a geometry database that can stream the geometries.

I believe we should go for the easiest possible approach for a first step:

  1. Generate the bounding boxes of all geometries of the building in fragments.
  2. Make a special culler for bounding boxes.
  3. Instead of loading the whole .frag file, cache the it locally using indexedDB.
  4. Request sets of geometry to the .frag file as they are discovered in the bounding box culler.

A longer term solution should probably be like this:

  • A backend buffer database only with geometries.
  • A backend item database with IFC properties, locations, etc.
  • The possibility to stream both geometry and properties to both databases as IFC are converted to fragments.

Alternative ⛕

No response

Additional context ☝️

No response

Validations ✅

  • [X] Read the docs.
  • [X] Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.

agviegas avatar Nov 09 '23 14:11 agviegas

  • This is impressive topic, and I tried finding boundingboxes for each element by expressID. It seems that this code is no longer correct with count ===1 https://github.com/IFCjs/components/blob/main/src/fragments/FragmentBoundingBox/index.ts#L126 .
  • So I changed a few things to find the boundingbox. It serves selectionwindow and selectionshape...

RyugaRyuzaki avatar Nov 25 '23 07:11 RyugaRyuzaki

I'm investigating this these days, let's see if I can come up with something before the end of this week!

agviegas avatar Nov 25 '23 11:11 agviegas

Done! See here.

agviegas avatar Jun 20 '24 19:06 agviegas