15 lines
408 B
OpenSCAD
15 lines
408 B
OpenSCAD
module rounded_ngon(num, r, rounding = 0) {
|
|
function v(a) = let (d = 360/num, v = floor((a+d/2)/d)*d) (r-rounding) * [cos(v), sin(v)];
|
|
polygon([for (a=[0:360-1]) v(a) + rounding*[cos(a),sin(a)]]);
|
|
}
|
|
|
|
//rounded_ngon(5, 100, 50);
|
|
|
|
module ngon( num, r) {
|
|
polygon( [for ( i = [0:num-1], a=i*360/num) [ r*cos(a), r*sin(a) ] ]);
|
|
}
|
|
for( i = [0:100]) {
|
|
translate([i,0,0])
|
|
rotate([0,90,0])
|
|
ngon( 360, 1);
|
|
} |