Giter Site home page Giter Site logo

Comments (11)

agviegas avatar agviegas commented on August 17, 2024 1

The reason you are experiencing performance issues is that you are not using the culler. As explained in the docs, the culler is needed to improve the performance of bigger scenes.

When I load the IFC without using the culler, it looks like in your video:

2024-07-01.10-49-40.mp4

I just used exactly the same code as in the IfcLoader tutorial, but changed the loading function to add the loaded fragments to the culler:

const cullers = components.get(OBC.Cullers);
const culler = cullers.create(world);
culler.threshold = 10;

async function loadIfc() {
  const file = await fetch(
    "../../../../../resources/parisa.ifc",
  );
  const data = await file.arrayBuffer();
  const buffer = new Uint8Array(data);
  const model = await fragmentIfcLoader.load(buffer);
  model.name = "example";
  world.scene.three.add(model);

  for (const child of model.children) {
    if (child instanceof THREE.InstancedMesh) {
      culler.add(child);
    }
  }

  culler.needsUpdate = true;

  world.camera.controls.addEventListener("sleep", () => {
    culler.needsUpdate = true;
  });
}

This is the result:

2024-07-01.10-41-02.mp4

from components.

agviegas avatar agviegas commented on August 17, 2024 1

I don't know if that's possible, the library is not designed to do that. Nevertheless, I'll try to address this issue today, so maybe you want to wait until I check this out to see if you can use the latest version directly

from components.

shahbaziparisa avatar shahbaziparisa commented on August 17, 2024

The reason you are experiencing performance issues is that you are not using the culler. As explained in the docs, the culler is needed to improve the performance of bigger scenes.

When I load the IFC without using the culler, it looks like in your video:

2024-07-01.10-49-40.mp4
I just used exactly the same code as in the IfcLoader tutorial, but changed the loading function to add the loaded fragments to the culler:

const cullers = components.get(OBC.Cullers);
const culler = cullers.create(world);
culler.threshold = 10;

async function loadIfc() {
  const file = await fetch(
    "../../../../../resources/parisa.ifc",
  );
  const data = await file.arrayBuffer();
  const buffer = new Uint8Array(data);
  const model = await fragmentIfcLoader.load(buffer);
  model.name = "example";
  world.scene.three.add(model);

  for (const child of model.children) {
    if (child instanceof THREE.InstancedMesh) {
      culler.add(child);
    }
  }

  culler.needsUpdate = true;

  world.camera.controls.addEventListener("sleep", () => {
    culler.needsUpdate = true;
  });
}

This is the result:

2024-07-01.10-41-02.mp4

The reason you are experiencing performance issues is that you are not using the culler. As explained in the docs, the culler is needed to improve the performance of bigger scenes.

When I load the IFC without using the culler, it looks like in your video:

2024-07-01.10-49-40.mp4
I just used exactly the same code as in the IfcLoader tutorial, but changed the loading function to add the loaded fragments to the culler:

const cullers = components.get(OBC.Cullers);
const culler = cullers.create(world);
culler.threshold = 10;

async function loadIfc() {
  const file = await fetch(
    "../../../../../resources/parisa.ifc",
  );
  const data = await file.arrayBuffer();
  const buffer = new Uint8Array(data);
  const model = await fragmentIfcLoader.load(buffer);
  model.name = "example";
  world.scene.three.add(model);

  for (const child of model.children) {
    if (child instanceof THREE.InstancedMesh) {
      culler.add(child);
    }
  }

  culler.needsUpdate = true;

  world.camera.controls.addEventListener("sleep", () => {
    culler.needsUpdate = true;
  });
}

This is the result:

2024-07-01.10-41-02.mp4

Please check this model
https://solidcloud.parisashahbazi.com/orange.ifc

load parts with your code by culler takes a lot of time.
I need sth like in the first part of the video like: https://3dviewer.net/.
Is it possible to make it faster for good appearance by culling?

culler-s.mp4

from components.

agviegas avatar agviegas commented on August 17, 2024

@shahbaziparisa I can take a look to improve it. That said, keep in mind that we are a small team and we won't be able to take a look at it until the end of the week.

I understand your situation at work, but we are making this code for free and we can't go faster. Insisting more in all our networks (LinkedIn, That Open People, etc) won't make us go faster 😅 If you are really in a hurry, you can also look for a solution and contribute with a pull request. I'll get back to you when I have news!

For now, I'm reopening this issue.

from components.

shahbaziparisa avatar shahbaziparisa commented on August 17, 2024

@shahbaziparisa I can take a look to improve it. That said, keep in mind that we are a small team and we won't be able to take a look at it until the end of the week.

I understand your situation at work, but we are making this code for free and we can't go faster. Insisting more in all our networks (LinkedIn, That Open People, etc) won't make us go faster 😅 If you are really in a hurry, you can also look for a solution and contribute with a pull request. I'll get back to you when I have news!

For now, I'm reopening this issue.

Thanks a million.
Sorry for my questions

from components.

shahbaziparisa avatar shahbaziparisa commented on August 17, 2024

@shahbaziparisa I can take a look to improve it. That said, keep in mind that we are a small team and we won't be able to take a look at it until the end of the week.

I understand your situation at work, but we are making this code for free and we can't go faster. Insisting more in all our networks (LinkedIn, That Open People, etc) won't make us go faster 😅 If you are really in a hurry, you can also look for a solution and contribute with a pull request. I'll get back to you when I have news!

For now, I'm reopening this issue.

Hi
unfortunately after a month I could not solve performance problem for my client.When I use latest version I have to use tiles and culling When I use it all details did not appear .
If I have to use first version like openbim 1.3.2 tell me please for high performance.

my model is this :
https://drive.google.com/file/d/1CVEMAn-6sepB7K4VRkwM-pH1UrB38We0/view?usp=sharing

result should be like this:
Screenshot 2024-07-27 at 7 36 42 PM

but with latest version 2.1.14 and using culler result is this:

tiles-s.mp4

what is different with this template?
https://thatopen.github.io/engine_web-ifc/demo/

from components.

agviegas avatar agviegas commented on August 17, 2024

Hi! As said above, we'll take a look at this asap. This is a free and open source project, so you are also free to address the issue yourself and propose a solution. Otherwise, we'll take a look when we can, hopefully soon.

from components.

shahbaziparisa avatar shahbaziparisa commented on August 17, 2024

Hi! As said above, we'll take a look at this asap. This is a free and open source project, so you are also free to address the issue yourself and propose a solution. Otherwise, we'll take a look when we can, hopefully soon.
Thanks.
So I have to use old versions for large files yes?

from components.

agviegas avatar agviegas commented on August 17, 2024

You can use whatever fits your needs. We'll fix performance in the modern version as soon as we can

from components.

shahbaziparisa avatar shahbaziparisa commented on August 17, 2024

You can use whatever fits your needs. We'll fix performance in the modern version as soon as we can

Can we use the latest version and the old version on the same project?

from components.

agviegas avatar agviegas commented on August 17, 2024

Hi @shahbaziparisa I've been checking out this IFC and the problem is that each brick is a different geometry. The result is that when I only load the walls, I get 86,000 meshes, which result in 86,000 draw calls.

image

Our library deduplicates geometry according to the IFC. This IFC doesn't have any deduplication, so we just represent what we find. The reason this IFC is visible in other viewers is because they merge the geometry in a single buffergeometry, which in this specific case is favourable.

This is not a problem of the culler, but a problem of the IFC itself. I think this problem has 2 possible solutions:

  1. Create your own loader using our core library using a merging strategy rather than an instancing strategy like we do. This might be a lot of work, and most tools of our library (like highlighting) won't work with it, so I don't recommend you to do this.

  2. Create a deduplication algorithm and apply it to the IFC to this IFC to optimize it before loading it in the viewer. This is something we might want to implement in the library ourselves, so we could maybe implement it and add it to the library, so you can just use it.

I think 2 is the best way to go. I'm closing this issue for now, feel free to create a new issue requesting a deduplication feature and we can take care. Cheers!

from components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.