solid.Shape.resize
solid.Shape: S = resize (S, SZ)
solid.Shape: S = resize (S, SZ, 'Uniform', TF)
Scale a shape to a size.
S = resize (S, SZ) scales the shape evenly so
that its bounding box is as large as it can be within the sizes
SZ = [x, y, z] in millimetres; a size of
0 leaves that direction free. resize (S, [30, 0, 0])
makes the shape 30 long in x and keeps its proportions. The
corner of the box at the least x, y and z stays
where it is, and every face keeps its type: a cylinder stays a
cylinder.
With 'Uniform' set to false each direction given is
scaled to its size on its own and a direction left at 0 keeps its
size, as OpenSCAD’s resize does. Flat faces stay planes, but a
curved face stretched so is no longer a cylinder, a cone or a sphere:
Open CASCADE carries it as the exact B-spline surface it becomes, so
solid.Shape.faces finds a stretched cylinder among the faces of
type 'bspline', not 'cylinder'.
## A sphere of diameter 10 stretched into an ellipsoid 40 by 20 by 10 E = resize (solid.sphere (5), [40, 20, 0], 'Uniform', false); |
See also: solid.Shape.scale, solid.ellipsoid, geom.Region.resize
Source Code: solid.Shape