scaleFunction in std::transform
Scale a solid, a sketch, or a helix.
This is really useful for resizing parts. You can create a part and then scale it to the correct size.
For sketches, you can use this to scale a sketch and then loft it with another sketch.
The x, y, z, and factor arguments are dimensionless multipliers, not physical
distances. Unlike translate, scale does not accept a length such as 10mm. To resize
an object with a known size, divide the target length by the current length. For example,
targetWidth / seedWidth produces the dimensionless scale factor for the x axis.
By default the transform is applied in local sketch axis, therefore the origin will not move.
If you want to apply the transform in global space, set global to true. The origin of the
model will move. If the model is not centered on origin and you scale globally it will
look like the model moves and gets bigger at the same time. Say you have a square
(1,1) - (1,2) - (2,2) - (2,1) and you scale by 2 globally it will become
(2,2) - (2,4)...etc so the origin has moved from (1.5, 1.5) to (2,2).
NOTE: Currently,, revolved bodies don't support being scaled in a non-uniform way (i.e. scaled differently along each axis).
Arguments
| Name | Type | Description | Required |
|---|---|---|---|
objects | [Solid; 1+] or [Sketch; 1+] or [Helix; 1+] or ImportedGeometry | The solid, sketch, helix, or set of solids, sketches, or helices to scale. | Yes |
x | number(_) | The dimensionless scale factor for the x axis. | No |
y | number(_) | The dimensionless scale factor for the y axis. | No |
z | number(_) | The dimensionless scale factor for the z axis. | No |
global | bool | If true, the transform is applied in global space. The origin of the model will move. By default, the transform is applied in local sketch axis, therefore the origin will not move. | No |
factor | number(_) | If given, scale the solid by this dimensionless factor. Equivalent to setting x, y and z all to this number. Incompatible with x, y or z. | No |
Returns
[Solid; 1+] or [Sketch; 1+] or [Helix; 1+] or ImportedGeometry