mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-06 14:56:47 +02:00
added circular_sector
This commit is contained in:
16
src/circual_sector.scad
Normal file
16
src/circual_sector.scad
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user