Genesis icon indicating copy to clipboard operation
Genesis copied to clipboard

How to load points as entities?

Open kyleleey opened this issue 1 year ago • 3 comments

Hi,

Is there a way to load a large number of points(spheres) into genesis as one entity? In my case these points can be set to still, mainly for collision detection with other entites. And since in my case the points number are very large (~1e5), I assume it's not possible to directly use sphere morph for each point.

Is the current "particle entity" suitable for this case (assign many points as particles to one entity)? And how to initialize it?

Thanks for your answer in advance!!

kyleleey avatar Dec 21 '24 17:12 kyleleey

I don't think the current released code can do this. One hacky way is probably to initialize a "particle entity" for example MPM, and then manually fix them in each timesteps.

wangyian-me avatar Dec 22 '24 05:12 wangyian-me

Thanks for the reply!

In this case, is there an example code of how I can use a bunch of particle locations to initialize the morphs for this entity? Or even a hacky way of where do you suggest to directly reset all the sampled particles in a MPM entity

kyleleey avatar Dec 22 '24 18:12 kyleleey

No worry I find a simple (and hacky) way is:

  1. define a new morph class to load particle positions,
  2. assign the material as PBD.Particle, since now only pbd_solver supports fix particle functionality,
  3. add a few lines in ParticleEntity() to directly use the initialized particles as the particles for simulation.

kyleleey avatar Dec 22 '24 20:12 kyleleey