AnalyticalPyBulletClient.convert_mesh_to_body
- AnalyticalPyBulletClient.convert_mesh_to_body(mesh, frame, _name=None, concavity=False, mass=0)[source]
Convert compas mesh and its frame to a pybullet body.
- Parameters
mesh (
compas.datastructures.Mesh
)frame (
compas.geometry.Frame
)_name (
str
, optional) – Name of the mesh for tagging in PyBullet’s GUIconcavity (
bool
, optional) – WhenFalse
(the default), the mesh will be loaded as its convex hull for collision checking purposes. WhenTrue
, a non-static mesh will be decomposed into convex parts using v-HACD.mass (
float
, optional) – Mass of the body to be created, in kg. If0
mass is given (the default), the object is static.
- Returns
Notes
If this method is called several times with the same
mesh
instance, but themesh
has been modified in between calls, PyBullet’s default caching behavior will prevent it from recognizing these changes. It is best practice to create a new mesh instance or to make use of the frame argument, if applicable. If this is not possible, PyBullet’s caching behavior can be changed withpybullet.setPhysicsEngineParameter(enableFileCaching=0)
.