[OpenSCAD] Creating pie (pizza slice) shape (need a dynamic length array)

TLC123 torleif.ceder at gmail.com
Sun Sep 16 12:34:11 EDT 2018


Oh thanks. That really makes things more elegant.

                module slice(r = 10, deg = 30) { 
                fn=$fn!=0?$fn :round(deg/10);         degn=(deg%360); 
                step=degn/fn;   start=min(degn ,0);  end=max(degn,0); 
                polygon(r*[[0,0], for(i=[start:step:end]) [cos(i),
sin(i)]]);     }

                slice(10, 130);



--
Sent from: http://forum.openscad.org/



More information about the Discuss mailing list