Scale.from_factors
- classmethod Scale.from_factors(factors, frame=None)[source]
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.0] * 3, frame) >>> points = [p.transformed(S) for p in points] >>> print(points) [Point(x=2.000, y=5.000, z=0.000), Point(x=2.000, y=15.000, z=0.000)]