mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-23 14:54:12 +02:00
added ring_extrude.scad
This commit is contained in:
16
src/ring_extrude.scad
Normal file
16
src/ring_extrude.scad
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
module ring_extrude(shape_pts, radius, angle = 360, twist = 0, scale = 1.0, triangles = "RADIAL") {
|
||||||
|
frags = $fn > 0 ?
|
||||||
|
($fn >= 3 ? $fn : 3) :
|
||||||
|
max(min(360 / $fa, radius * 6.28318 / $fs), 5);
|
||||||
|
|
||||||
|
angle_step = 360 / frags;
|
||||||
|
as = [for(a = [0:angle_step:angle]) [90, 0, a]];
|
||||||
|
|
||||||
|
angles = as[len(as) - 1][2] == angle ? as : concat(as, [[90, 0, angle]]);
|
||||||
|
pts = [for(a = angles) [radius * cos(a[2]), radius * sin(a[2])]];
|
||||||
|
|
||||||
|
polysections(
|
||||||
|
cross_sections(shape_pts, pts, angles, twist, scale),
|
||||||
|
triangles = triangles
|
||||||
|
);
|
||||||
|
}
|
Reference in New Issue
Block a user