PositionConstraint.from_sphere
- classmethod PositionConstraint.from_sphere(link_name, sphere, weight=1.0)[source]
Create a
PositionConstraint
from acompas.geometry.Sphere
.- Parameters:
- link_name
str
The name of the link this contraint refers to.
- sphere
compas.geometry.Sphere
Sphere defining the bounding volume this constraint refers to.
- weight
float
A weighting factor for this constraint. Denotes relative importance to other constraints. Closer to zero means less important. Defaults to
1
.
- link_name
- Returns:
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.)