PositionConstraint.from_box
- classmethod PositionConstraint.from_box(link_name, box, weight=1.0)[source]
Create a
PositionConstraint
from acompas.geometry.Box
.- Parameters:
- link_name: :obj:`str`
The name of the link this contraint refers to.
- box
compas.geometry.Box
Box defining the bounding volume this constraint refers to.
- weight
float
, optional A weighting factor for this constraint. Denotes relative importance to other constraints. Closer to zero means less important. Defaults to
1
.
- Returns:
Examples
>>> from compas.geometry import Frame >>> from compas.geometry import Box >>> box = Box(4, 4, 4, Frame.worldXY()) >>> pc = PositionConstraint.from_box('link_0', box)