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

Inherited Attributes

DATASCHEMA

The schema of the data of this object.

JSONSCHEMA

The schema of the JSON representation of the data of this object.

JSONSCHEMANAME

basis_vectors

The basis vectors from the rotation component of the transformation matrix.

data

Return a Transformation object's to a data dict.

determinant

The determinant of the matrix of the transformation.

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.

list

Flattens the 4x4 transformation matrix into a list of 16 numbers.

name

The name of the object.

projection

The projection component of the transformation matrix.

rotation

The rotation component of the transformation matrix.

scale

The scale component of the transformation matrix.

shear

The shear component of the transformation matrix.

translation

The translation component of the transformation matrix.

translation_vector

Methods

from_frame

Creates a reflection object that mirrors wrt the given frame.

from_plane

Creates a reflection object that mirrors wrt the given plane.

Inherited Methods

concatenate

Concatenate another transformation to this transformation.

concatenated

Concatenate two transformations into one Transformation.

copy

Returns a copy of the transformation.

decomposed

Decompose the Transformation into its Scale, Shear, Rotation, Translation and Projection components.

from_change_of_basis

Computes a change of basis transformation between two frames.

from_data

Creates a Transformation from a data dict.

from_euler_angles

Construct a transformation from a rotation represented by Euler angles.

from_frame_to_frame

Computes a transformation between two frames.

from_json

Construct an object from serialized data contained in a JSON file.

from_jsonstring

Construct an object from serialized data contained in a JSON string.

from_list

Creates a Transformation from a list of 16 numbers.

from_matrix

Creates a Transformation from a 4x4 matrix-like object.

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

Serialize the data representation of an object to a JSON file.

to_jsonstring

Serialize the data representation of an object to a JSON string.

transpose

Transpose the matrix of this transformation.

transposed

Create a transposed copy of this transformation.

validate_data

Validate the object's data against its data schema (self.DATASCHEMA).

validate_json

Validate the object's data against its json schema (self.JSONSCHEMA).