Scale.from_factors

classmethod Scale.from_factors(factors, frame=None)

Construct a scale transformation from scale factors.

Parameters
  • factors ([float, float, float]) – The scale factors along X, Y, Z.

  • frame ([point, vector, vector] | compas.geometry.Frame, optional) – The anchor frame for the scaling transformation.

Returns

compas.geometry.Scale – A scale transformation.

Examples

>>> from compas.geometry import Point, Frame
>>> point = Point(2, 5, 0)
>>> frame = Frame(point, (1, 0, 0), (0, 1, 0))
>>> points = [point, Point(2, 10, 0)]
>>> S = Scale.from_factors([2.] * 3, frame)
>>> [p.transformed(S) for p in points]
[Point(2.000, 5.000, 0.000), Point(2.000, 15.000, 0.000)]