CollisionMesh
- class compas_fab.robots.CollisionMesh(mesh, id, frame=None, root_name=None)[source]
Bases:
Data
Represents a collision mesh.
- Parameters
mesh (
compas.datastructures.Mesh
) – The collision mesh. Ideally it is as coarse as possible.id (
str
) – The id of the mesh, used to identify it for later operations (add_collision_mesh()
,remove_collision_mesh()
,append_collision_mesh()
etc.)frame (
compas.geometry.Frame
, optional) – The frame of the mesh. Defaults tocompas.geometry.Frame.worldXY()
.root_name (
str
) – The name of the root link the collision mesh will be placed in. Defaults to'world'
.
- Attributes
mesh (
compas.datastructures.Mesh
) – The collision mesh. Ideally it is as coarse as possible.id (
str
) – The id of the mesh, used to identify it for later operations (add_collision_mesh()
,remove_collision_mesh()
,append_collision_mesh()
etc.)frame (
compas.geometry.Frame
, optional) – The frame of the mesh. Defaults tocompas.geometry.Frame.worldXY()
.root_name (
str
) – The name of the root link the collision mesh will be placed in. Defaults to'world'
.
Examples
>>> mesh = Mesh.from_stl(compas_fab.get('planning_scene/floor.stl')) >>> cm = CollisionMesh(mesh, 'floor') >>> cm.frame Frame(Point(0.000, 0.000, 0.000), Vector(1.000, 0.000, 0.000), Vector(0.000, 1.000, 0.000))
Methods
Construct a collision mesh from its data representation.
Scales the collision mesh uniformly.
Copies the collision mesh, and scales the copy uniformly.
Get the data dictionary that represents the collision mesh.
Inherited Methods
Converts the instance to a string.
Make an independent copy of the data object.
Construct an object from serialized data contained in a JSON file.
Construct an object from serialized data contained in a JSON string.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Serialize the data representation of an object to a JSON file.
Serialize the data representation of an object to a JSON string.
Validate the object's data against its data schema.
Validate the object's data against its json schema.