PositionConstraint

class compas_fab.robots.PositionConstraint(link_name, bounding_volume, weight=1.0)[source]

Bases: compas_fab.robots.constraints.Constraint

Constrains a link to be within a certain bounding volume.

The name of the link this contraint refers to.

Type

string

bounding_volume

The volume this constraint refers to.

Type

compas.geometry.BoundingVolume

weight

A weighting factor for this constraint. Denotes relative importance to other constraints. Closer to zero means less important. Defaults to 1.

Type

float, optional

Examples

>>> from compas.geometry import Sphere
>>> from compas_fab.robots import PositionConstraint
>>> from compas_fab.robots import BoundingVolume
>>> bv = BoundingVolume.from_sphere(Sphere((3,4,5), 0.5))
>>> pc = PositionConstraint('link_0', bv, weight=1.)

Methods

__init__(link_name, bounding_volume[, weight])

Initialize self.

copy()

from_box(link_name, box[, weight])

Creates a PositionConstraint from a compas.geometry.Box.

from_mesh(link_name, mesh[, weight])

Creates a PositionConstraint from a compas.datastructures.Mesh.

from_sphere(link_name, sphere[, weight])

Creates a PositionConstraint from a compas.geometry.Sphere.

scale(scale_factor)

transform(transformation)

Attributes

JOINT

ORIENTATION

POSITION

possible_types

__init__(link_name, bounding_volume, weight=1.0)[source]

Initialize self. See help(type(self)) for accurate signature.