Dynamic particle injection and dynamic meshes #207
-
By using the model builder to build a sim, the particle numbers and meshes have to be finalised and considered to be invariant throughout the sim. Can the model class be expanded to include particle injection (and deletion), and also add dynamic properties to meshes, e.g. translations and rotations. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @anthropoy! The class Take a look at the For example, here are some fields of interest for the particles:
Likewise, meshes can have their point positions updated to reflect transformations (or even deformations), see Also keep in mind that you might want to update/refit any particle hash grid and mesh BVH if collisions are needed. |
Beta Was this translation helpful? Give feedback.
Hi @anthropoy!
The class
wp.sim.ModelBuilder()
is there to help initializing a simulation model, but nothing stops you from manually updating the model's particles/meshes afterwards, even though it's currently a process that is a bit more involved.Take a look at the
wp.sim.Model
andwp.sim.State
classes to have an idea of the relevant arrays that could be updated for your needs.For example, here are some fields of interest for the particles:
wp.sim.State.particle_q
.wp.sim.State.particle_qd
.wp.sim.Model.particle_mass
.wp.sim.Model.particle_inv_mass
.wp.sim.Model.particle_flags
.wp.sim.Model.particle_radius
.Likewise, meshes can have their point positions updated to reflect transforma…