Reflection

class compas.geometry.Reflection(matrix=None)[source]

Bases: Transformation

Class representing a reflection transformation.

A reflection transformation mirrors points at a plane.

Parameters

matrix (list[list[float]], optional) – A 4x4 matrix (or similar) representing a reflection.

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

from_frame

Construct a reflection transformation that mirrors wrt the given frame.

from_plane

Construct a reflection transformation 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 components.

from_change_of_basis

Construct a change of basis transformation between two frames.

from_data

Construct an object of this type from the provided data.

from_euler_angles

Construct a transformation from a rotation represented by Euler angles.

from_frame_to_frame

Construct 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 list[list[float]] object.

inverse

Returns the inverse transformation.

invert

Invert this transformation.

inverted

Returns the inverse transformation.

to_data

Convert an object to its native data representation.

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.

validate_json

Validate the object's data against its json schema.