CollisionMesh

class compas_fab.robots.CollisionMesh[source]

Bases: Data

Represents a collision mesh.

Parameters:
meshcompas.datastructures.Mesh

The collision mesh. Ideally it is as coarse as possible.

idstr

The id of the mesh, used to identify it for later operations (add_collision_mesh(), remove_collision_mesh(), append_collision_mesh() etc.)

framecompas.geometry.Frame, optional

The frame of the mesh. Defaults to compas.geometry.Frame.worldXY().

root_namestr

The name of the root link the collision mesh will be placed in. Defaults to 'world'.

Attributes:
meshcompas.datastructures.Mesh

The collision mesh. Ideally it is as coarse as possible.

idstr

The id of the mesh, used to identify it for later operations (add_collision_mesh(), remove_collision_mesh(), append_collision_mesh() etc.)

framecompas.geometry.Frame, optional

The frame of the mesh. Defaults to compas.geometry.Frame.worldXY().

root_namestr

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=Point(x=0.0, y=0.0, z=0.0), xaxis=Vector(x=1.0, y=0.0, z=0.0), yaxis=Vector(x=0.0, y=1.0, z=0.0))

Methods

scale

Scales the collision mesh uniformly.

scaled

Copies the collision mesh, and scales the copy uniformly.

Inherited Methods

ToString

Converts the instance to a string.

copy

Make an independent copy of the data object.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

to_json

Convert an object to its native data representation and save it to a JSON file.

to_jsonstring

Convert an object to its native data representation and save it to a JSON string.

validate_data

Validate the data against the object's data schema.