make amort ends configurable
parent
9e5a94b5f5
commit
fb3254cb26
|
@ -2,27 +2,35 @@ $fn = 50;
|
|||
tube_length = 4; // tube length in studs
|
||||
piston_length = 3; // piston length in studs
|
||||
travel_length = piston_length-2; // piston travel in studs
|
||||
top_type = "axle"; // top mounting type: 'pin' = pin hole, 'ball' = ball end hole, 'axle' = axle hole, "axle_rod" = axle, "ball_end" = ball
|
||||
bottom_type = "ball"; // bottom mounting type
|
||||
|
||||
travel = min(travel_length, piston_length-2, tube_length-2);
|
||||
|
||||
//difference() { union() {
|
||||
|
||||
difference() {
|
||||
translate([0, 0, 2.3]) cylinder(r=4, h=tube_length*8-2.3);
|
||||
translate([0, 0, 2.3]) ball_end_n();
|
||||
translate([0, 0, 8]) cylinder(r=3.2, h=tube_length*8);
|
||||
tube_offset = (bottom_type == "axle" || bottom_type == "axle_rod" ? 1 : (bottom_type == "ball_end" ? 0.4 : 0));
|
||||
union() {
|
||||
translate([0, 0, 8]) cylinder(r=4, h=tube_length*8-8);
|
||||
mount_base(type=bottom_type, r=4);
|
||||
}
|
||||
mount_hole(bottom_type);
|
||||
translate([0, 0, 8+tube_offset]) cylinder(r=3.2, h=tube_length*8-tube_offset);
|
||||
translate([-5, -0.5, tube_length*8-6]) cube(size=[10, 1, 3], center=false);
|
||||
}
|
||||
|
||||
color([1, 0.5, 0.5]) translate([0, 0, (tube_length+piston_length-1)*8]) rotate([180, 0, 0])
|
||||
{
|
||||
difference() {
|
||||
translate([0, 0, 2.3]) union() {
|
||||
cylinder(r=3, h=piston_length*8-2.3);
|
||||
cylinder(r=4, h=8-2.3);
|
||||
union() {
|
||||
//translate([0, 0, 4]) cylinder(r=3, h=piston_length*8-4);
|
||||
//rotate([90, 0, 0]) translate([0, 4, -4]) cylinder(r=4, h=8);
|
||||
translate([0, 0, 8]) cylinder(r=3, h=piston_length*8-8);
|
||||
mount_base(top_type);
|
||||
}
|
||||
mount_hole(top_type);
|
||||
translate([-5, -0.7, (piston_length-travel-1)*8+3]) cube(size=[10, 1.4, travel*8+3], center=false);
|
||||
translate([0, 0, 2.3]) ball_end_n();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,14 +42,41 @@ cube(size=[8, 1, 3], center=false);
|
|||
|
||||
//rotate([10, 0, 0]) axleround(h=8);
|
||||
|
||||
// ball end shift 2.3mm down
|
||||
module mount_base(type, r = 3) {
|
||||
if (type == "pin" || type == "ball" || type == "axle") {
|
||||
cylinder(r=4, h=8+0.1);
|
||||
}
|
||||
else if (type == "axle_rod") {
|
||||
axleround(h=8+0.1);
|
||||
}
|
||||
else if (type == "ball_end") {
|
||||
translate([0, 0, 4]) sphere(r=3);
|
||||
translate([0, 0, 6]) linear_extrude(scale=r, height=2) circle(r=1);
|
||||
}
|
||||
}
|
||||
|
||||
module mount_hole(type) {
|
||||
if (type == "pin") {
|
||||
rotate([90, 0, 0]) translate([0, 4, -4]) pin_hole();
|
||||
}
|
||||
else if (type == "ball") {
|
||||
ball_end_n();
|
||||
}
|
||||
else if (type == "axle") {
|
||||
translate([0, 0, -0.1]) axleround(h=8+0.1, axleradius=2.4, axlemesh=1.85);
|
||||
translate([0, 0, -0.1]) cylinder($fs=0.5, h=0.8+0.1, r=5);
|
||||
}
|
||||
}
|
||||
|
||||
// cut for ball end
|
||||
module ball_end_n() {
|
||||
translate([0, 0, 1.7]) sphere(r=3.05);
|
||||
translate([0, 0, -0.1]) cylinder(r=2.9, h=2);
|
||||
translate([0, 0, 4]) sphere(r=3.05);
|
||||
translate([0, 0, 2.3-0.1]) cylinder(r=2.9, h=2);
|
||||
translate([0, 0, -0.1]) cylinder(r=5, h=2.4);
|
||||
}
|
||||
|
||||
module axleround(h = 24, axleradius = 2.3, axlemesh = 1.7) {
|
||||
translate([0, 0, -h/2]) difference() {
|
||||
difference() {
|
||||
cylinder($fn=16, r=axleradius, h=h);
|
||||
translate([axlemesh/2, axlemesh/2, -1]) cube([axleradius, axleradius, h+2]);
|
||||
translate([axlemesh/2, -axlemesh/2-axleradius, -1]) cube([axleradius, axleradius, h+2]);
|
||||
|
@ -49,3 +84,11 @@ module axleround(h = 24, axleradius = 2.3, axlemesh = 1.7) {
|
|||
translate([-axlemesh/2-axleradius, -axlemesh/2-axleradius, -1]) cube([axleradius, axleradius, h+2]);
|
||||
}
|
||||
}
|
||||
|
||||
module pin_hole(height=8) {
|
||||
union() {
|
||||
translate([0, 0, -0.1]) cylinder($fs=0.5, h=height+0.2, r=2.5);
|
||||
translate([0, 0, -0.1]) cylinder($fs=0.5, h=0.8+0.1, r=3);
|
||||
translate([0, 0, height-0.8]) cylinder($fs=0.5, h=0.8+0.1, r=3);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
// Link with ends for ball inserts
|
||||
// (c) Vitaliy Filippov 2014, license: CC-BY-SA 4.0
|
||||
|
||||
$fn=40;
|
||||
length=64; // 8U spacing between balls, like LEGO Black Link 9 (32293)
|
||||
//length=16;
|
||||
$fn=50;
|
||||
length=9; // 9 stud, like LEGO Black Link 9 (32293)
|
||||
|
||||
difference() {
|
||||
union() {
|
||||
ball_end_p();
|
||||
translate([-3, 0, 0]) cube(size=[6, length, 2.5]);
|
||||
translate([0, length, 0]) ball_end_p();
|
||||
translate([-3, 0, 0]) cube(size=[6, (length-1)*8, 2.5]);
|
||||
translate([0, (length-1)*8, 0]) ball_end_p();
|
||||
}
|
||||
ball_end_n();
|
||||
translate([0, length, 0]) ball_end_n();
|
||||
translate([0, (length-1)*8, 0]) ball_end_n();
|
||||
}
|
||||
|
||||
module ball_end() {
|
||||
|
@ -30,6 +29,6 @@ module ball_end_p() {
|
|||
}
|
||||
|
||||
module ball_end_n() {
|
||||
translate([0, 0, 1.7]) sphere(r=3.2);
|
||||
translate([0, 0, 1.7]) sphere(r=3.05);
|
||||
translate([0, 0, -0.1]) cylinder(r=2.9, h=2);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue