Frame
- class compas.geometry.Frame[source]
Bases:
Geometry
A frame is defined by a base point and two orthonormal base vectors.
- Parameters:
- point[float, float, float] |
compas.geometry.Point
The origin of the frame.
- xaxis[float, float, float] |
compas.geometry.Vector
, optional The x-axis of the frame. Defaults to the unit X vector.
- yaxis[float, float, float] |
compas.geometry.Vector
, optional The y-axis of the frame. Defaults to the unit Y vector.
- namestr, optional
The name of the frame.
- point[float, float, float] |
Notes
All input vectors are orthonormalized when creating a frame, with the first vector as starting point.
Examples
>>> from compas.geometry import Point >>> from compas.geometry import Vector >>> f = Frame([0, 0, 0], [1, 0, 0], [0, 1, 0]) >>> f = Frame(Point(0, 0, 0), Vector(1, 0, 0), Vector(0, 1, 0)) >>> f = Frame([0, 0, 0])
- Attributes:
- axeslist of
compas.geometry.Vector
, read-only The XYZ axes of the frame.
- axis_angle_vector
compas.geometry.Vector
, read-only The axis-angle vector representing the rotation of the frame.
- normal
compas.geometry.Vector
, read-only The normal of the base plane of the frame.
- point
compas.geometry.Point
The base point of the frame.
- quaternion
compas.geometry.Quaternion
, read-only The quaternion from the rotation given by the frame.
- xaxis
compas.geometry.Vector
The local X axis of the frame.
- yaxis
compas.geometry.Vector
The local Y axis of the frame.
- zaxis
compas.geometry.Vector
, read-only The Z axis of the frame.
- axeslist of
Methods
The Euler angles from the rotation given by the frame.
Construct a frame from an axis-angle vector representing the rotation.
Construct a frame from a rotation represented by Euler angles.
Construct a frame from a list of 12 or 16 float values.
Construct a frame from a matrix.
Constructs a frame from a plane.
Constructs a frame from 3 points.
Construct a frame from a rotation represented by quaternion coefficients.
Constructs a frame from a Rotation.
Constructs a frame from a Transformation.
Returns the object's coordinates in the local coordinate system of the frame.
Convert the frame to a transformation.
Returns the object's coordinates in the global coordinate frame.
Transform the frame.
Construct the world XY frame.
Construct the world YZ frame.
Construct the world ZX frame.
Inherited Methods
Converts the instance to a string.
Compute the axis-aligned bounding box of the geometry.
Compute the oriented bounding box of the geometry.
Make an independent copy of the data object.
Construct an object of this type from a JSON file.
Construct an object of this type from a JSON string.
Rotate the geometry.
Returns a rotated copy of this geometry.
Scale the geometry.
Returns a scaled copy of this geometry.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert an object to its native data representation and save it to a JSON file.
Convert an object to its native data representation and save it to a JSON string.
Returns a transformed copy of this geometry.
Translate the geometry.
Returns a translated copy of this geometry.
Validate the data against the object's data schema.