PBD3DEntity(PBD 3D 实体)#
- class genesis.engine.entities.pbd_entity.PBD3DEntity(scene, solver, material, morph, surface, particle_size, idx, particle_start, edge_start, elem_start, vvert_start, vface_start, name: str | None = None)[source]#
Bases:
PBDTetEntityPBD entity represented by a 3D mesh.
- Parameters:
scene (Scene) – The simulation scene this entity is part of.
solver (Solver) – The PBD solver instance managing this entity.
material (Material) – Material model defining physical properties such as density and compliance.
morph (Morph) – Morph object specifying shape and initial transform (position and rotation).
surface (Surface) – Surface or texture representation.
particle_size (float) – Target size for particle spacing.
idx (int) – Unique index of this entity within the scene.
particle_start (int) – Starting index of this entity’s particles in the global particle buffer.
edge_start (int) – Starting index of this entity’s edges in the global edge buffer.
elem_start (int) – Starting index of this entity’s element in the global buffer.
vvert_start (int) – Starting index of this entity’s visual vertices.
vface_start (int) – Starting index of this entity’s visual faces.
- sample()[source]#
Sample and preprocess the mesh for the PBD tetrahedral entity.
Applies transformation from the morph, stores mesh vertices and faces, and performs remeshing based on the particle size.
- property n_elems#
The number of tetrahedral elements in the mesh.
- property elem_start#
The starting index of the elements in the global solver.
- property elem_end#
The ending index of the elements in the global solver.