echo(version=version()); // number of fragments, set number of faces, global $fn=200; // colors alpha = 0.75; green = [0, 0.5, 0, alpha]; yellow = [1, 0.75, 0, alpha]; red = [1, 0, 0, alpha]; blue = [0, 0, 1, alpha]; // * hides object // % makes in semi-transpartent? // rotate_extrude() rotates a 2D shape around the Z axis. // Note that the 2D shape must be either completely on the // positive or negative side of the X axis. *color([1,1,0, 0.1]) rotate_extrude() translate([10, 0]) square(50 ); // Using a shape that touches the X axis is allowed and produces // 3D objects that don't have a hole in the center. height = 80; radius = 7.5; wall = 3; cubeWidth = 10; cube2Width = 8; function cyl(h, r, w) = [[r-w,0],[r,0],[r,h],[r-w,h]]; color(yellow) { translate([0, 0, height/2 - 10]) { difference() { // Tube x Crown // Tube difference() { rotate_extrude() translate([0, -height/2, 0]) polygon( points=cyl(height, radius, wall)); *union() { cylinder(height+10, radius-wall, radius-wall, true); rotate(-90) { translate([-cubeWidth/2, 10, 0]) { cube([cubeWidth, 2, 20]); } translate([-cube2Width/2, 0, 2]) { cube([cube2Width, 12, 15]); } } } } // Crown crownThickness = 2; steps = 4; crownHeight = 7.5; color(green) { union() { // Union for Crown Elements for (angle = [0 : 180/steps : 180-180/steps]) { rotate([0, 0, angle+45/2]) { translate([-radius*2, -crownThickness/2, 6]) { cube([100, crownThickness, crownHeight]); } } } } union() { // Union for Crown Elements for (angle = [0 : 180/steps : 180-180/steps]) { rotate([0, 0, angle+45/2]) { translate([-radius*2, -crownThickness/2, 25]) { cube([100, crownThickness, 100]); } } } } } } // end difference Tube x Crown } } // connection plate connectorWidth = 40; r = 5; cw = connectorWidth - r*2; cw2 = cw/2; connectorHeight = 5/2; ch = connectorHeight; // Plate color(green) { difference(){ color("blue") translate([-cw2, -cw2, 0]) { minkowski() { cube([cw, cw, ch]); cylinder(ch, r, r); } } // Small Holes /* ----------- */ holeDiameter = 3; // M3 inter diameter holeOffsetFromCenter = 12; /* ----------- */ holeRadius = holeDiameter/2; hr = holeRadius; holeOffset = cw2 - holeOffsetFromCenter; ho = holeOffset; color("red") { translate([-cw2+ho, -cw2+ho, -1]) { cylinder(ch*3, hr, hr); } translate([+cw2-ho, -cw2+ho, -1]) { cylinder(ch*3, hr, hr); } translate([+cw2-ho, +cw2-ho, -1]) { cylinder(ch*3, hr, hr); } translate([-cw2+ho, +cw2-ho, -1]) { cylinder(ch*3, hr, hr); } } // Central Hole color("red") { translate([0, 0, -1]) { cylinder(ch*3, radius, radius); } } } // end diff } // end color // Collector color(blue) { r = 30; z = 43.5 + r; translate([0, 0, z-40+r]) { difference() { sphere(r); // Outer Sphere sphere(r - 3); // Inner Sphere translate([-r, -r, -r+r/3]) { // Diff Sphere with Cube cube([r*2, r*2, r*2]); } translate([0, 0, -r]) { // Central Hole cylinder(10, radius, radius); } } // end diff } } // Scaffolding translate([0, 0, 0]) { color(red) { thickness = 2; steps = 2; height = 43.5; difference() { union() { for (angle = [0 : 180/steps : 180-180/steps]) { rotate([0, 0, angle]) { translate([-radius*2, -thickness/2, 0]) { cube([radius*4, thickness, height]); } } } } translate([0, 0, -r]) { // Central Hole cylinder(100, radius, radius); } } } } echo ("height", height);