PositionConstraint.from_sphere
- classmethod PositionConstraint.from_sphere(link_name, sphere, weight=1.0)
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 to1
.
- Returns
Examples
>>> from compas_fab.robots import PositionConstraint >>> from compas.geometry import Sphere >>> sphere = Sphere((3,4,5), 0.5) >>> pc = PositionConstraint.from_sphere('link_0', sphere, weight=1.)