PositionConstraint.from_sphere

classmethod PositionConstraint.from_sphere(link_name, sphere, weight=1.0)[source]

Create a PositionConstraint from a compas.geometry.Sphere.

Parameters:
link_namestr

The name of the link this contraint refers to.

spherecompas.geometry.Sphere

Sphere defining the bounding volume this constraint refers to.

weightfloat

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

Returns:
PositionConstraint

Examples

>>> from compas_fab.robots import PositionConstraint
>>> from compas.geometry import Sphere
>>> sphere = Sphere(radius=0.5, point=[3,4,5])
>>> pc = PositionConstraint.from_sphere('link_0', sphere, weight=1.)