Reflection
- class compas.geometry.Reflection(matrix=None)[source]
Bases:
compas.geometry.transformations.transformation.Transformation
Creates a
Reflection
that mirrors points at a plane.Examples
>>> point = [1, 1, 1] >>> normal = [0, 0, 1] >>> R1 = Reflection.from_plane((point, normal)) >>> R2 = Transformation([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, -1, 2], [0, 0, 0, 1]]) >>> R1 == R2 True
Methods
concatenate
(other)Concatenate another transformation to this transformation.
concatenated
(other)Concatenate two transformations into one
Transformation
.copy
()Returns a copy of the transformation.
Decompose the
Transformation
into itsScale
,Shear
,Rotation
,Translation
andProjection
components.from_change_of_basis
(frame_from, frame_to)Computes a change of basis transformation between two frames.
from_data
(data)Creates a
Transformation
from a data dict.from_euler_angles
(euler_angles[, static, …])Construct a transformation from a rotation represented by Euler angles.
from_frame
(frame)Creates a reflection object that mirrors wrt the given frame.
from_frame_to_frame
(frame_from, frame_to)Computes a transformation between two frames.
from_json
(filepath)Construct an object from serialized data contained in a JSON file.
from_jsonstring
(string)Construct an object from serialized data contained in a JSON string.
from_list
(numbers)Creates a
Transformation
from a list of 16 numbers.from_matrix
(matrix)Creates a
Transformation
from a 4x4 matrix-like object.from_plane
(plane)Creates a reflection object that mirrors wrt the given plane.
inverse
()Returns the inverse transformation.
invert
()Invert this transformation.
inverted
()Returns the inverse transformation.
to_data
()Convert a
Transformation
object to a data dict.to_json
(filepath[, pretty])Serialize the data representation of an object to a JSON file.
to_jsonstring
([pretty])Serialize the data representation of an object to a JSON string.
Transpose the matrix of this transformation.
Create a transposed copy of this transformation.
Validate the object’s data against its data schema (self.DATASCHEMA).
Validate the object’s data against its json schema (self.JSONSCHEMA).