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

TLC123 torleif.ceder at gmail.com
Sun Sep 16 11:38:53 EDT 2018


                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(
                    concat(
                        [[0,0]],
                        [for(i=[start:step:end+step])  
                            [cos(min(end,i))*r,sin(min(end,i))*r]]  ));}

                slice(10, 130);



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



More information about the Discuss mailing list