Origin.from_rotation

classmethod Origin.from_rotation(rotation, point=[0, 0, 0])

Constructs a frame from a Rotation.

Parameters
  • rotation (Rotation) – The rotation defines the orientation of the frame.

  • point (list of float, optional) – The origin of the frame. Defaults to [0, 0, 0].

Returns

compas.geometry.Frame – The constructed frame.

Examples

>>> from compas.geometry import Rotation
>>> f1 = Frame([1, 1, 1], [0.68, 0.68, 0.27], [-0.67, 0.73, -0.15])
>>> R = Rotation.from_frame(f1)
>>> f2 = Frame.from_rotation(R, point=f1.point)
>>> f1 == f2
True