Frame
- class compas.geometry.Frame(point, xaxis, yaxis, **kwargs)[source]
Bases:
compas.geometry.primitives._primitive.Primitive
A frame is defined by a base point and two orthonormal base vectors.
- Parameters
point (point) – The origin of the frame.
xaxis (vector) – The x-axis of the frame.
yaxis (vector) – The y-axis of the frame.
- Attributes
data (dict) – The data representation of the frame.
point (
compas.geometry.Point
) – The base point of 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
) – The local Z axis of the frame.normal (
compas.geometry.Vector
) – The normal vector of the base plane of the frame.quaternion (
compas.geometry.Quaternion
) – The quaternion representing the rotation of the frame.axis_angle_vector (
compas.geometry.Vector
) – The rotation vector of the frame.
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))
Attributes
DATASCHEMA
The schema of the data of this object.
JSONSCHEMANAME
axis_angle_vector
The axis-angle vector representing the rotation of the frame.
data
The data dictionary that represents the frame.
normal
The normal of the base plane of the frame.
point
The base point of the frame.
quaternion
The quaternion from the rotation given by the frame.
xaxis
The local X axis of the frame.
yaxis
The local Y axis of the frame.
zaxis
The Z axis of the frame.
Inherited Attributes
JSONSCHEMA
The schema of the JSON representation of the data of this object.
dtype
The type of the object in the form of a '2-level' import and a class name.
guid
The globally unique identifier of the object.
jsondefinitions
Reusable schema definitions.
jsonstring
The representation of the object data in JSON format.
jsonvalidator
JSON schema validator for draft 7.
name
The name of the object.
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 its data representation.
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 frame1 in the local coordinates of frame2.
Returns the object's coordinates in the local coordinate system of the frame.
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
Make an independent copy of the data object.
Construct an object from serialized data contained in a JSON file.
Construct an object from serialized data contained in a JSON string.
Convert an object to its native data representation.
Serialize the data representation of an object to a JSON file.
Serialize the data representation of an object to a JSON string.
Returns a transformed copy of this geometry.
Validate the object's data against its data schema (self.DATASCHEMA).
Validate the object's data against its json schema (self.JSONSCHEMA).