Created
March 6, 2019 17:56
-
-
Save ridercz/9b41ecbf246343425ffb1513b00b65fb to your computer and use it in GitHub Desktop.
Limiting angles of rotate_extrude in OpenSCAD 2015.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intersection() { | |
rotate_extrude() { | |
translate([20, 0]) circle(5, $fn = 16); | |
} | |
translate([0, 0, -5]) linear_extrude(10) rotate_splice(5, 20, 50); | |
} | |
module rotate_splice(count, angle_length, radius) { | |
for(i = [0:count - 1]) { | |
angle_begin = 360 / count * i; | |
angle_end = angle_begin + angle_length; | |
slice = [ | |
[0, 0], | |
[radius * sin(angle_begin), radius * cos(angle_begin)], | |
[radius * sin(angle_end), radius * cos(angle_end)] | |
]; | |
polygon(slice); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment