Created
April 11, 2020 04:51
-
-
Save daisycamber/f151b564dfb68de00424a44e97e516b2 to your computer and use it in GitHub Desktop.
This is a ring I created
This file contains 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
RESOLUTION = 8; | |
$fn = RESOLUTION; | |
SECTIONS_FACTOR = 1; | |
SECTIONS = 256/SECTIONS_FACTOR; | |
RADIUS = 1; | |
RING_RADIUS = 18/2; | |
BAND_WIDTH = 4; | |
SEGMENT_LENGTH = ((2 * 3.14159 * RING_RADIUS + RADIUS)/SECTIONS+0.0452)*SECTIONS_FACTOR;//0.27; | |
HOLE_RADIUS = 0.5; | |
PATTERN_OFFSET=HOLE_RADIUS; | |
module uncut_ring_segment(){ | |
cylinder(SEGMENT_LENGTH,RADIUS,RADIUS, center=true); | |
translate([0,-1,-SEGMENT_LENGTH/2]) cube([BAND_WIDTH, RADIUS * 2, SEGMENT_LENGTH]); | |
translate([BAND_WIDTH,0,0])cylinder(SEGMENT_LENGTH,RADIUS,RADIUS, center=true); | |
} | |
module ring_segment(i,pos){ | |
uncut_ring_segment(); | |
for(j = [0:1]){ | |
translate([pos * (BAND_WIDTH-PATTERN_OFFSET*2) + PATTERN_OFFSET,RADIUS,-SEGMENT_LENGTH/2])cylinder(SEGMENT_LENGTH,HOLE_RADIUS,HOLE_RADIUS); | |
} | |
} | |
positions = [0,1,2,4,6,8,10,8,6,5,6,8,10,8,6,5,4,3,2,1,2,3,5,6,8,10,8,6,5,3,2,1,0]; | |
module ring(){ | |
randoms = rands(1,10,SECTIONS); | |
for(i = [0:SECTIONS]){ | |
pos = positions[i%(128/4)]; | |
rotate([0,90,0]) rotate([i * 360/SECTIONS,0,0]) translate([0,RING_RADIUS+RADIUS,0]) ring_segment(i,pos/10.0);//(sin(i*14*2)+1+(randoms[i]/10-5/10))*0.4+0.1); | |
} | |
} | |
rotate([180,0,0])ring(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment