1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-04-20 14:11:52 +02:00

added circular_sector

This commit is contained in:
Justin Lin 2017-03-12 19:13:22 +08:00
parent 1a7a324b44
commit 6f34a38793

16
src/circual_sector.scad Normal file
View File

@ -0,0 +1,16 @@
module circular_sector(radius, angles, fn = 24) {
r = radius / cos(180 / fn);
step = -360 / fn;
points = concat([[0, 0]],
[for(a = [angles[0] : step : angles[1] - 360])
[r * cos(a), r * sin(a)]
],
[[r * cos(angles[1]), r * sin(angles[1])]]
);
difference() {
circle(radius, $fn = fn);
polygon(points);
}
}