From 1e77a27585c7d694d5d8d088b85399f5beda00d6 Mon Sep 17 00:00:00 2001 From: D Delmar Davis Date: Tue, 27 Jun 2023 15:34:09 -0400 Subject: Add a motormount in the rem --- Triangles.scad | 229 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ basePlate2.scad | 3 +- baseplate.scad | 13 +++- motorMount.svg | 21 ++++++ nextLayer.svg | 12 ++- 5 files changed, 273 insertions(+), 5 deletions(-) create mode 100644 Triangles.scad create mode 100644 motorMount.svg diff --git a/Triangles.scad b/Triangles.scad new file mode 100644 index 0000000..f101c3c --- /dev/null +++ b/Triangles.scad @@ -0,0 +1,229 @@ +/* +Triangles.scad + Author: Tim Koopman + https://github.com/tkoopman/Delta-Diamond/blob/master/OpenSCAD/Triangles.scad + + angleCA + /|\ + a / H \ c + / | \ + angleAB ------- angleBC + b + +Standard Parameters + center: true/false + If true same as centerXYZ = [true, true, true] + + centerXYZ: Vector of 3 true/false values [CenterX, CenterY, CenterZ] + center must be left undef + + height: The 3D height of the Triangle. Ignored if heights defined + + heights: Vector of 3 height values heights @ [angleAB, angleBC, angleCA] + If CenterZ is true each height will be centered individually, this means + the shape will be different depending on CenterZ. Most times you will want + CenterZ to be true to get the shape most people want. +*/ + +/* +Triangle + a: Length of side a + b: Length of side b + angle: angle at point angleAB +*/ +module Triangle( + a, b, angle, height=1, heights=undef, + center=undef, centerXYZ=[false,false,false]) +{ + // Calculate Heights at each point + heightAB = ((heights==undef) ? height : heights[0])/2; + heightBC = ((heights==undef) ? height : heights[1])/2; + heightCA = ((heights==undef) ? height : heights[2])/2; + centerZ = (center || (center==undef && centerXYZ[2]))?0:max(heightAB,heightBC,heightCA); + + // Calculate Offsets for centering + offsetX = (center || (center==undef && centerXYZ[0]))?((cos(angle)*a)+b)/3:0; + offsetY = (center || (center==undef && centerXYZ[1]))?(sin(angle)*a)/3:0; + + pointAB1 = [-offsetX,-offsetY, centerZ-heightAB]; + pointAB2 = [-offsetX,-offsetY, centerZ+heightAB]; + pointBC1 = [b-offsetX,-offsetY, centerZ-heightBC]; + pointBC2 = [b-offsetX,-offsetY, centerZ+heightBC]; + pointCA1 = [(cos(angle)*a)-offsetX,(sin(angle)*a)-offsetY, centerZ-heightCA]; + pointCA2 = [(cos(angle)*a)-offsetX,(sin(angle)*a)-offsetY, centerZ+heightCA]; + + polyhedron( + points=[ pointAB1, pointBC1, pointCA1, + pointAB2, pointBC2, pointCA2 ], + triangles=[ + [0, 1, 2], + [3, 5, 4], + [0, 3, 1], + [1, 3, 4], + [1, 4, 2], + [2, 4, 5], + [2, 5, 0], + [0, 5, 3] ] ); +} + +/* +Isosceles Triangle + Exactly 2 of the following paramaters must be defined. + If all 3 defined H will be ignored. + b: length of side b + angle: angle at points angleAB & angleBC. +*/ +module Isosceles_Triangle( + b, angle, H=undef, height=1, heights=undef, + center=undef, centerXYZ=[true, false, false]) +{ + valid = (angle!=undef)?((angle < 90) && (b!=undef||H!=undef)) : (b!=undef&&H!=undef); + ANGLE = (angle!=undef) ? angle : atan(H / (b/2)); + a = (b==undef)?(H/sin((180-(angle*2))/2)) : + (b / cos(ANGLE))/2; + B = (b==undef)? (cos(angle)*a)*2:b; + if (valid) + { + Triangle(a=a, b=B, angle=ANGLE, height=height, heights=heights, + center=center, centerXYZ=centerXYZ); + } else { + echo("Invalid Isosceles_Triangle. Must specify any 2 of b, angle and H, and if angle used angle must be less than 90"); + } +} + +/* +Right Angled Triangle + Create a Right Angled Triangle where the hypotenuse will be calculated. + + |\ + a| \ + | \ + ---- + b + a: length of side a + b: length of side b +*/ +module Right_Angled_Triangle( + a, b, height=1, heights=undef, + center=undef, centerXYZ=[false, false, false]) +{ + Triangle(a=a, b=b, angle=90, height=height, heights=heights, + center=center, centerXYZ=centerXYZ); +} + +/* +Wedge + Is same as Right Angled Triangle with 2 different heights, and rotated. + Good for creating support structures. +*/ +module Wedge(a, b, w1, w2) +{ + rotate([90,0,0]) + Right_Angled_Triangle(a, b, heights=[w1, w2, w1], centerXYZ=[false, false, true]); +} + +/* +Equilateral Triangle + Create a Equilateral Triangle. + + l: Length of all sides (a, b & c) + H: Triangle size will be based on the this 2D height + When using H, l is ignored. +*/ +module Equilateral_Triangle( + l=10, H=undef, height=1, heights=undef, + center=undef, centerXYZ=[true,false,false]) +{ + L = (H==undef)?l:H/sin(60); + Triangle(a=L,b=L,angle=60,height=height, heights=heights, + center=center, centerXYZ=centerXYZ); +} + +/* +Trapezoid + Create a Basic Trapezoid (Based on Isosceles_Triangle) + + d + /----\ + / | \ + a / H \ c + / | \ + angle ------------ angle + b + + b: Length of side b + angle: Angle at points angleAB & angleBC + H: The 2D height at which the triangle should be cut to create the trapezoid + heights: If vector of size 3 (Standard for triangles) both cd & da will be the same height, if vector have 4 values [ab,bc,cd,da] than each point can have different heights. +*/ +module Trapezoid( + b, angle=60, H, height=1, heights=undef, + center=undef, centerXYZ=[true,false,false]) +{ + validAngle = (angle < 90); + adX = H / tan(angle); + + // Calculate Heights at each point + heightAB = ((heights==undef) ? height : heights[0])/2; + heightBC = ((heights==undef) ? height : heights[1])/2; + heightCD = ((heights==undef) ? height : heights[2])/2; + heightDA = ((heights==undef) ? height : ((len(heights) > 3)?heights[3]:heights[2]))/2; + + // Centers + centerX = (center || (center==undef && centerXYZ[0]))?0:b/2; + centerY = (center || (center==undef && centerXYZ[1]))?0:H/2; + centerZ = (center || (center==undef && centerXYZ[2]))?0:max(heightAB,heightBC,heightCD,heightDA); + + // Points + y = H/2; + bx = b/2; + dx = (b-(adX*2))/2; + + pointAB1 = [centerX-bx, centerY-y, centerZ-heightAB]; + pointAB2 = [centerX-bx, centerY-y, centerZ+heightAB]; + pointBC1 = [centerX+bx, centerY-y, centerZ-heightBC]; + pointBC2 = [centerX+bx, centerY-y, centerZ+heightBC]; + pointCD1 = [centerX+dx, centerY+y, centerZ-heightCD]; + pointCD2 = [centerX+dx, centerY+y, centerZ+heightCD]; + pointDA1 = [centerX-dx, centerY+y, centerZ-heightDA]; + pointDA2 = [centerX-dx, centerY+y, centerZ+heightDA]; + + validH = (adX < b/2); + + if (validAngle && validH) + { + polyhedron( + points=[ pointAB1, pointBC1, pointCD1, pointDA1, + pointAB2, pointBC2, pointCD2, pointDA2 ], + triangles=[ + [0, 1, 2], + [0, 2, 3], + [4, 6, 5], + [4, 7, 6], + [0, 4, 1], + [1, 4, 5], + [1, 5, 2], + [2, 5, 6], + [2, 6, 3], + [3, 6, 7], + [3, 7, 0], + [0, 7, 4] ] ); + } else { + if (!validAngle) echo("Trapezoid invalid, angle must be less than 90"); + else echo("Trapezoid invalid, H is larger than triangle"); + } +} + + +// Examples +Triangle(a=5, b=15, angle=33, centerXYZ=[true,false,false]); +translate([20,0,0]) Right_Angled_Triangle(a=5, b=20, centerXYZ=[false,true,false]); +translate([45,0,0]) Wedge(a=5, b=20, w1=10, w2=5); +translate([-20,0,0]) Trapezoid(b=20, angle=33, H=4, height=5, centerXYZ=[true,false,true]); + +translate([0,10,0]) Isosceles_Triangle(b=20, angle=33); +translate([30,10,0]) Isosceles_Triangle(b=20, H=5); +translate([-30,10,0]) Isosceles_Triangle(angle=33, H=5, center=true); + +translate([15,-25,0]) Equilateral_Triangle(l=20); +translate([-15,-25,0]) Equilateral_Triangle(H=20); \ No newline at end of file diff --git a/basePlate2.scad b/basePlate2.scad index 388a0f0..83fedee 100644 --- a/basePlate2.scad +++ b/basePlate2.scad @@ -1,6 +1,5 @@ include ; - module screw_head(location=[0.0,0.0,0.0],rotation=0.0) { translate(location) { // rotate([0,0,rotation]){ @@ -53,6 +52,8 @@ module base_plate(){ } } + +//motor_mount(); projection(cut=false){ base_plate(); } diff --git a/baseplate.scad b/baseplate.scad index 40ddac8..b9dd078 100644 --- a/baseplate.scad +++ b/baseplate.scad @@ -51,7 +51,18 @@ module base_plate(){ } } } +module motor_mount(){ +intersection() { + translate ([-10.0,0.0,0.0]) { + cube([35.0,60.0,10.0], center=true); + } + base_plate(); +} + +} + projection(cut=false){ -base_plate(); +//base_plate(); +motor_mount(); } diff --git a/motorMount.svg b/motorMount.svg new file mode 100644 index 0000000..d4c1c90 --- /dev/null +++ b/motorMount.svg @@ -0,0 +1,21 @@ + + + +OpenSCAD Model + + diff --git a/nextLayer.svg b/nextLayer.svg index 15485b3..62da9b6 100644 --- a/nextLayer.svg +++ b/nextLayer.svg @@ -28,12 +28,12 @@ inkscape:document-units="mm" showgrid="false" inkscape:zoom="0.50972781" - inkscape:cx="230.51518" - inkscape:cy="231.4961" + inkscape:cx="121.63354" + inkscape:cy="207.95412" inkscape:window-width="1309" inkscape:window-height="456" inkscape:window-x="72" - inkscape:window-y="207" + inkscape:window-y="179" inkscape:window-maximized="0" inkscape:current-layer="svg84" /> </rdf:RDF> </metadata> + <path + d="m 41.627132,14.769077 h -2.5 v -28 h 2.5 v -16 H 6.6271324 v 60 H 41.627132 Z m -5.98557,-35.1337 -0.35062,-0.1817 -0.288591,-0.2695 -0.205175,-0.3374 -0.106538,-0.3803 v -0.3948 l 0.106538,-0.3803 0.205175,-0.3374 0.288591,-0.2695 0.35062,-0.1817 0.38662,-0.0803 0.39396,0.0269 0.37209,0.1323 0.3226,0.2277 0.24921,0.3063 0.15732,0.3622 0.05377,0.3912 -0.05377,0.3912 -0.15732,0.3622 -0.24921,0.3063 -0.3226,0.2277 -0.37209,0.1323 -0.39396,0.0269 z m -25.50003,22.49998 -0.3505996,-0.18167 -0.2886,-0.269533 -0.2052,-0.337395 -0.1065,-0.380241 V 0.571636 l 0.1065,-0.380241 0.2052,-0.337395 0.2886,-0.269533 0.3505996,-0.18167 0.3866,-0.08034 0.394,0.02695 0.3721,0.13224 0.3226,0.22772 0.2492,0.306314 0.1573,0.362191 0.0538,0.391205 -0.0538,0.391205 -0.1573,0.362191 -0.2492,0.306314 -0.3226,0.22772 -0.3721,0.13224 -0.394,0.02695 z m 25.50003,22.50002 -0.35062,-0.1817 -0.288591,-0.2695 -0.205175,-0.3374 -0.106538,-0.3803 v -0.3948 l 0.106538,-0.3803 0.205175,-0.3374 0.288591,-0.2695 0.35062,-0.1817 0.38662,-0.0803 0.39396,0.0269 0.37209,0.1323 0.3226,0.2277 0.24921,0.3063 0.15732,0.3622 0.05377,0.3912 -0.05377,0.3912 -0.15732,0.3622 -0.24921,0.3063 -0.3226,0.2277 -0.37209,0.1323 -0.39396,0.0269 z" + stroke="#000000" + fill="#d3d3d3" + stroke-width="0.5" + id="path4278" /> </svg> -- cgit v1.2.3