89 lines
2.0 KiB
OpenSCAD

/*skew takes an array of six angles:
*x along y
*x along z
*y along x
*y along z
*z along x
*z along y
*/
module skew(dims) {
matrix = [
[ 1, tan(dims[0]), tan(dims[1]), 0 ],
[ tan(dims[2]), 1, tan(dims[3]), 0 ],
[ tan(dims[4]), tan(dims[5]), 1, 0 ],
[ 0, 0, 0, 1 ]
];
multmatrix(matrix)
children();
}
//$fn=50;
module sub() {
difference() {
union() {
intersection() {
union() {
color("Grey")
translate([0, 0, 1.5])
skew([0, 0, 0, 65, 0, 0])
scale([2, 26, 0.75])
cylinder(d1 = 1.5, d2 = 1.25, h = 4, center = true);
color("Grey")
translate([0, -2.5, 0])
scale([1.25, 9.25, 1])
sphere(r=2);
}
color("LightGrey")
translate([0, 4.75, -82.75])
sphere(r=87);
color("LightGrey")
scale([1, 5.5, 1.5])
translate([0, 0.40, 0])
sphere(r=4);
}
intersection() {
color("Thistle")
translate([0, -17, 0.5])
cube([6, 3, 1], center=true);
color("FireBrick")
translate([0, -20, 0])
rotate([0, 0, 45])
cube(8, center=true);
}
color("LightGrey")
translate([0, 5, 2])
union() {
translate([0, 0, 0.5]) cube([1, 2, 5], center=true);
translate([0, 0, 0]) cube([2, 3, 4], center=true);
translate([0, 1.45, 0]) cylinder(r=1, h=4, center=true);
translate([0, -1.55, 0]) cylinder(r=1, h=4, center=true);
}
color("LightGrey")
translate([0, 0, 1.5])
union() {
cube([1, 2, 3.25], center=true);
cube([2, 1, 3.25], center=true);
}
color("LightGrey")
translate([0, 9, 1.5])
cylinder(r=1, h=3.25, center=true);
translate([0, 12, 1.5])
cylinder(r=1, h=3.25, center=true);
}
translate([0, 0, -3]) cube([6, 50, 6], center=true);
}
}
sub();