If this project is your entrance to OpenSCAD you have chosen a very ambitious

problem that can't be tackled with the usual means of OpenSCAD.

linear_extrude() is not equipped for extruding objects with varying

diameter. It can do twist and a scale but the latter is a linear function it

calculates on its own. You want to specify a scale function.

Of course, your problem has a solution in OpenSCAD if you draw on an

advanced techique (and library) that lets you do almost every thing you want

- provided you can describe it in an affine way. You create a sequence of

polygons that describe the slices of your extrusion path and then coat this

sequence into a 3D object. To create the polygons you need a shape function

allowing you to specify the (pulsating) radius and a z-height. Finally you

need an operator that transforms a sequence of polygons into a 3D-manifold

respectively a proper polyhedron call. Note that *none of the polygons may

self-intersect and none two of the polygons may mutually intersect*.

The following code is fairly simple and does everything you need. You can

reimplement the shape function to have rounded corners and so on. I omitted

this to keep the example simple. The gen() function creates the polygon

sequence in a linear-extrusion fashion and is called twice to generate the

outer and the inner wall in the same fashion, but with opposite diameter

modulation. sweep() does the coating. You can find the lib by following the

Thingiverse link. I have updated the file right now to get rid of some nasty

RC3 warnings. The lib is quite rich and to find out what it else offers you

can call its help function help_Naca_sweep() and of course have a look into

the code and the thingiverse projects connected with it. Note that the

parameter closed=true tells sweep() to extrude a ring. You set it to false

if you extrude to a monolith only.

<

http://forum.openscad.org/file/t887/costower.png>

use <Naca_sweep.scad> //

https://www.thingiverse.com/thing:1208001N=50;

R=100;

r=8;

h=100;

f=3;

twist=20;

edges=4;

sweep(concat(gen(N, R), gen(N, R-3*r, false)), close = true);

function gen(N=100, R=R, outer=true) =

[for(i=outer?[0:N]:[N:-1:0])

let(s=outer?-1:1) // sign

let(a=360*f/N*i) // angle

let(r=R+s*r*cos(a)) // diameter

let(tz=h/N*i) // z-height

let(rz = twist/N*i) // twist

Rz(rz, shape(r, tz))]; // create polygon and rotate

function shape(r=100, z=0, N=edges) =

[for(i=[0:N])let(w=360/N*i) [r*sin(w), r*cos(w)

--

Sent from:

http://forum.openscad.org/_______________________________________________

OpenSCAD mailing list

[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org