PositionConstraint.from_box

classmethod PositionConstraint.from_box(link_name, box, weight=1.0)

Create a PositionConstraint from a compas.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 to 1.

Returns

PositionConstraint

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)