# Scaling polygons via sine waves

4 messages
Open this post in threaded view
|

## Scaling polygons via sine waves

 Ive just figured out how tl extrude a polygon on a loop, to create this spiral pattern. But my next feat is trying to scale each of these polygons, via a sinewave function of some sort, to create vase shapes, and patterns. Im new to this program so any help would be appreciated! Heres the code i have so far. layers = 30; layer_height = 7; z_rot = 10; amp = 40; vase(); module vase(){   for(z = [0:1:layers]) {                 translate([0, 0, z * layer_height]){                       rotate (z * -z_rot){                             linear_extrude(layer_height, twist = z_rot){                                    polygon (points=[             [10,-25],             [25,-10],             [25,10],             [10,25],             [-10,25],             [-25,10],             [-25,-10],             [-10,-25]             ]);             }          }       }   } } -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Scaling polygons via sine waves

 On 2020-02-13 04:42, Chaoticenigma wrote: > Ive just figured out how tl extrude a polygon on a loop, to create this > spiral pattern. But my next feat is trying to scale each of these > polygons, > via a sinewave function of some sort, to create vase shapes, and > patterns. > Im new to this program so any help would be appreciated! Heres the code > i > have so far. To create vase shapes using only linear_extrude in OpenSCAD, you can possibly accomplish what you want using a scale parameter taking a vector, but I have not tried it. It is stretching the concept of "linear_extrude" since it is no longer linear. As you say, you need to be able to scale the profile using e.g. a sine function in a sweep operation. I did exactly that to create a vase some time ago, but using AngelCAD where a sweep function exists for such purposes, see https://www.thingiverse.com/thing:2335400Carsten Arnholm _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org