Created
November 14, 2015 18:51
-
-
Save dagrende/f55fdb5d159a96608966 to your computer and use it in GitHub Desktop.
train carousel
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
function main(params) { | |
return union( | |
CSG.cylinder({start:[0,-75,0], end:[0,-74,0], radius: 30, resolution:36}), | |
CSG.cylinder({start:[0,-83,0], end:[0,90,0], radius: 2, resolution:36}), | |
shifter().translate([0, -80, 0]), | |
ball_bearing().translate([0, -80.5, 0]), | |
ball_bearing().translate([0, 80.5, 0]), | |
ball_bearing().translate([0, 83.5, 0]), | |
ball_bearing().translate([0, -84.5, -10]), | |
CSG.cylinder({start:[0,-90,0], end:[0,-80,0], radius: 2, resolution:36}).translate([0, 0, -10]), | |
CSG.cylinder({start:[0,75,0], end:[0,74,0], radius: 30, resolution:36}), | |
train_support(0), | |
train_support(90), | |
train_support(180), | |
train_support(270), | |
CSG.cylinder({start:[0,-85,-10], end:[0,-84, -10], radius: 30, resolution:36}).setColor(.5,.5,.5,.5), | |
cube(size=[8, 4, 49]).translate([-4, 80, -45]), | |
cube(size=[8, 4, 39]).translate([-4, -93, -45]) | |
).translate([0, 0, 45]); | |
} | |
function ball_bearing() { | |
return CSG.cylinder({start:[0,-1.2,0], end:[0,1.2,0], radius: 2.8, resolution:36}).setColor([0, 0, 1]) | |
} | |
function shifter() { | |
return linear_extrude({ height: 1 }, hull( circle(4),circle(4).translate([0,10,0]))).rotateZ(90).rotateX(90).translate([14, 0, -4]).setColor(0, 1, 0).rotateY(90); | |
} | |
function train_support(v) { | |
return union( | |
CSG.cylinder({start:[0,-80,0], end:[0,76,0], radius: 1, resolution:36}), | |
shifter().translate([0, -80, 0]), | |
CSG.cylinder({start:[0,-86,0], end:[0,-80,0], radius: 1, resolution:36}).translate([0, 0, -10]), | |
ball_bearing().translate([0, -84.5, -10]), | |
ball_bearing().translate([0, -74.5, 0]), | |
ball_bearing().translate([0, 74.5, 0]) | |
).translate([25 * cos(v), 0, 25 * sin(v)]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment