Scale.from_factors

classmethod Scale.from_factors(factors, frame=None)

Construct a scale transformation from scale factors.

Parameters
  • factors (list of float) – The scale factors along X, Y, Z.

  • frame (compas.geometry.Frame, optional) – The anchor frame for the scaling transformation. Defaults to None.

Returns

Scale – A scale transformation.

Examples

>>> 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)]