matrix_from_shear

compas.geometry.matrix_from_shear(angle, direction, point, normal)[source]

Constructs a shear matrix by an angle along the direction vector on the shear plane (defined by point and normal).

Parameters
Returns

list[list[float]] – A 4-by-4 transformation matrix.

Raises

ValueError – If direction and normal are not orthogonal.

Notes

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 (defined by point and normal).

Examples

>>> angle = 0.1
>>> direction = [0.1, 0.2, 0.3]
>>> point = [4, 3, 1]
>>> normal = cross_vectors(direction, [1, 0.3, -0.1])
>>> S = matrix_from_shear(angle, direction, point, normal)