mirror of
https://github.com/Theaninova/Brick-Monorail.git
synced 2026-01-08 09:42:55 +00:00
feat: endcap improvements
This commit is contained in:
56
track.scad
56
track.scad
@@ -1,6 +1,7 @@
|
||||
include <lib/BOSL/shapes.scad>;
|
||||
include <lib/BOSL/transforms.scad>;
|
||||
include <lib/BOSL/constants.scad>;
|
||||
include <lib/BOSL/beziers.scad>;
|
||||
|
||||
$LDU=0.4;
|
||||
|
||||
@@ -55,50 +56,51 @@ module brickSlot(w=1, l=1, h=3) {
|
||||
mirror_copy([0, 1, 0])
|
||||
translate([$tile / 2, $tile / 2, 0])
|
||||
cyl(d=$fillet, h=$plate * h, align=V_DOWN, $fn=12);
|
||||
difference () {
|
||||
cuboid([$stud+2*$LDU, $stud+2*$LDU, $studHeight], align=V_TOP);
|
||||
mirror_copy([1, -1, 0])
|
||||
mirror_copy([1, 0, 0])
|
||||
translate([$stud / 2, 0, 0])
|
||||
cyl(d=2*$LDU, h=$studHeight, align=V_TOP+V_RIGHT, $fn=12);
|
||||
}
|
||||
mirror_copy([1, 0, 0])
|
||||
mirror_copy([0, 1, 0])
|
||||
translate([$stud/2+$LDU, $stud/2+$LDU, 0])
|
||||
cyl(d=$fillet, h=$studHeight, align=V_TOP, $fn=12);
|
||||
cuboid([$stud, $stud, $studHeight * 2], align=V_TOP);
|
||||
}
|
||||
|
||||
module endCap() {
|
||||
module endCapStraight() {
|
||||
$width = $baseWidth - $plate * 2;
|
||||
union() {
|
||||
difference() {
|
||||
union() {
|
||||
cuboid([$width, $tile * 2, $tile], edges=EDGE_BOT_FR+EDGE_BOT_RT+EDGE_BOT_LF);
|
||||
mirror_copy([0, 1, 0])
|
||||
translate([0, $tile / 2, 0])
|
||||
cyl(l=$width + $studHeight * 2, d=$stud, orient=ORIENT_X, $fn=24);
|
||||
difference() {
|
||||
mirror_copy([0, 1, 0])
|
||||
translate([0, $tile / 2, 0])
|
||||
cyl(l=$width + $studHeight * 2, d=$stud, orient=ORIENT_X, $fn=24);
|
||||
mirror_copy([1, 0, 0])
|
||||
translate([$tile * 2, 0, -$stud / 2])
|
||||
rotate([0, -14, 0])
|
||||
cuboid([$studHeight * 10, $tile * 4, $LDU * 2], align=V_TOP+V_LEFT);
|
||||
}
|
||||
|
||||
translate([$tile, -$tile, 0]) cuboid([8 * $LDU, $LDU, $tile], align=V_RIGHT+V_FRONT);
|
||||
}
|
||||
// Fingernail slot
|
||||
mirror_copy([1, 0, 0])
|
||||
mirror_copy([0, 1, 0])
|
||||
translate([$width / 2, $tile / 2, 0])
|
||||
torus(d2=$edgeTolerance, d=$stud, orient=ORIENT_X, $fn=24);
|
||||
translate([$width / 2, 0, $tile / 2])
|
||||
cuboid([$LDU, $tile, $LDU])
|
||||
|
||||
translate([$plate, $tile / 2, $tile - $LDU]) cube([$LDU, $tile, $LDU]);
|
||||
translate([$width + $plate - $LDU, $tile / 2, $tile - $LDU]) cube([$LDU, $tile, $LDU]);
|
||||
|
||||
|
||||
// Brick slots
|
||||
mirror_copy([1, 0, 0])
|
||||
translate([$tile / 2, -$tile / 2, $tile / 2 - $plate])
|
||||
translate([$tile / 2, -$tile / 2, $tile / 2 - $plate * 2])
|
||||
brickSlot();
|
||||
// Bridging improvements
|
||||
translate([0, 0, $tile / 2 - $plate * 2]) cuboid([$tile * 2, $tile - 4 * $LDU, $LDU], align=V_FRONT);
|
||||
translate([0, -4 * $LDU, $tile / 2 - $plate * 2]) cuboid([$tile * 2, $stud, $LDU * 2], align=V_FRONT);
|
||||
|
||||
|
||||
// End Slots
|
||||
translate([-$tile, -$tile, 0]) cuboid([8 * $LDU, $LDU, $tile], align=V_LEFT+V_BACK);
|
||||
place_copies([[-$tile, -$tile + $LDU], [$tile + 8 * $LDU, -$tile, 0]])
|
||||
mirror_copy([1, 0, 0], cp=[-4 * $LDU, 0, 0])
|
||||
cyl(d=$fillet, h=$tile, $fn=12);
|
||||
}
|
||||
|
||||
// Rail
|
||||
translate([0, $teethTolerance / 2, $tile / 2]) cuboid([$teethRailWidth, $tile * 2 - $teethTolerance, $plate], align=V_TOP);
|
||||
translate([0, -$tile, $tile / 2]) group() {
|
||||
for (i = [0:(2 * $teeth - 1)]) {
|
||||
@@ -108,5 +110,15 @@ module endCap() {
|
||||
}
|
||||
}
|
||||
|
||||
module curve90(r=12) {
|
||||
translate([r * $tile, $tile, 0]) endCapStraight();
|
||||
translate([$tile, r * $tile, 0]) rotate(-90) endCapStraight();
|
||||
//ir = ($r
|
||||
path = [[2 * $tile, r * $tile, 0], [r * $tile / 2, r * $tile, 0], [r * $tile, r * $tile / 2, 0], [r * $tile, 2 * $tile, 0]];
|
||||
extrude_2d_shapes_along_bezier(path) {
|
||||
circle(r=10);
|
||||
}
|
||||
}
|
||||
|
||||
endCap();
|
||||
//curve90();
|
||||
endCapStraight();
|
||||
|
||||
Reference in New Issue
Block a user