Shear
- class compas.geometry.Shear(matrix=None, check=True)[source]
Bases:
compas.geometry.transformations.transformation.TransformationCreate a shear transformation.
A point P is transformed by the shear matrix into P” such that the vector P-P” is parallel to the direction vector and its extent is given by the angle of P-P’-P”, where P’ is the orthogonal projection of P onto the shear plane.
- Parameters
matrix (4x4 matrix-like, optional) – A 4x4 matrix (or similar) representing a shear transformation.
- Raises
ValueError – If the default constructor is used, and the provided transformation matrix is not a shear matrix.
Examples
>>>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
Transformationinto itsScale,Shear,Rotation,TranslationandProjectioncomponents.from_angle_direction_plane(angle, direction, ...)- Parameters
angle (
float) -- The angle in radians.
from_change_of_basis(frame_from, frame_to)Computes a change of basis transformation between two frames.
from_data(data)Creates a
Transformationfrom a data dict.from_entries(shear_entries)Creates a
Shearfrom the 3 factors for x-y, x-z, and y-z axes.from_euler_angles(euler_angles[, static, ...])Construct a transformation from a rotation represented by Euler angles.
from_frame(frame)Computes a transformation from world XY to 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
Transformationfrom a list of 16 numbers.from_matrix(matrix)Creates a
Transformationfrom a 4x4 matrix-like object.inverse()Returns the inverse transformation.
invert()Invert this transformation.
inverted()Returns the inverse transformation.
to_data()Convert a
Transformationobject 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).