Instantly share code, notes, and snippets.

Embed
What would you like to do?
OpenScad model / animation for an elastic spring shield
module ring(inner_radius, thickness, height)
{
outer_radius = inner_radius + thickness;
padding = 0.1;
difference()
{
cylinder(r=outer_radius,h=height,center=true);
cylinder(r=inner_radius,h=height+padding,center=true);
translate([0,outer_radius,0])
cube([outer_radius*2,outer_radius*2,height+padding], center = true);
translate([outer_radius * 0.9,0,0])
cube([height+padding,outer_radius,height+padding], center = true);
}
}
module binder_ring(position, size)
{
thickness = 0.2;
height = 0.3;
translate(position)
{
translate([-0.5 + $t * 0.5, -1 + $t, 0])
rotate([0,0,75 - $t * 80])
ring(size, thickness, height, $fn = 20);
mirror([0,1,0])
translate([-0.5 + $t * 0.5, -1 + $t, 0])
rotate([0,0,75 - $t * 80])
ring(size, thickness, height, $fn = 20);
}
}
module arrow(scale)
{
polygon([[0,-1*scale],[0,scale],[0.7*scale,0]],[[0,1,2]]);
translate([-0.5*scale,0,0])
cube([scale,scale,1],center = true);
}
render()
{
// cylinder body
difference()
{
resize([2.8 - 0.5 * $t ,2.24 + 0.5 * $t,10])
cylinder($fn = 20);
resize([2.3 - 0.411 * $t, 1.84 + 0.411 * $t,11])
cylinder($fn = 20);
}
// leaves
translate([-0.5 + $t,0,0])
{
translate([-0.05,0.005,0])
rotate([0,0,-30 + 60 * $t])
cube([0.25,1.20,10]);
translate([0.2,-0.005,0])
rotate([0,0,180])
{
rotate([0,0,-(-30 + 60 * $t)])
cube([0.25,1.19,10]);
}
}
// rings
binder_ring([-1.3,0,0.7], 1.5);
binder_ring([-1.3,0,5], 1.5);
binder_ring([-1.3,0,9.3], 1.5);
}
translate([-3 + 0.7 * $t,0,2])
arrow(1.5);
translate([-3 + 0.7 * $t,0,5])
arrow(1.5);
translate([-3 + 0.7 * $t,0,8])
arrow(1.5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment