PositionConstraint.from_box
- classmethod PositionConstraint.from_box(link_name, box, weight=1.0)
Create a
PositionConstraint
from acompas.geometry.Box
.- Parameters
link_name (
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 to1
.
- Returns
Examples
>>> from compas.geometry import Frame >>> from compas.geometry import Box >>> box = Box(Frame.worldXY(), 4, 4, 4) >>> pc = PositionConstraint.from_box('link_0', box)