diff --git a/README.md b/README.md index 6e8c395..fbb5695 100644 --- a/README.md +++ b/README.md @@ -67,4 +67,4 @@ For generating a specific part: `python3 rbuild.py -b yBar --nightly -c micro -t custom` Generated stls are put into the `stl/` directories. The actual variable values for different profiles can be found in -[rack/profiles.scad](rack/profiles.scad). \ No newline at end of file +[rack/profiles.scad](config/profiles.scad). \ No newline at end of file diff --git a/config/common.scad b/config/common.scad new file mode 100644 index 0000000..a83ed0e --- /dev/null +++ b/config/common.scad @@ -0,0 +1,7 @@ +// Config aggregator + +include <./dowel.scad> +include <./magnet.scad> +include <./slack.scad> +include <./printing.scad> +include <./rackFrame.scad> \ No newline at end of file diff --git a/helper/dowel.scad b/config/dowel.scad similarity index 100% rename from helper/dowel.scad rename to config/dowel.scad diff --git a/helper/magnet.scad b/config/magnet.scad similarity index 100% rename from helper/magnet.scad rename to config/magnet.scad diff --git a/config/printing.scad b/config/printing.scad new file mode 100644 index 0000000..9f44214 --- /dev/null +++ b/config/printing.scad @@ -0,0 +1,2 @@ + +defaultLayerHeight = 0.3; \ No newline at end of file diff --git a/rack/config.scad b/config/rackFrame.scad similarity index 52% rename from rack/config.scad rename to config/rackFrame.scad index 92b9296..a69a4fa 100644 --- a/rack/config.scad +++ b/config/rackFrame.scad @@ -1,22 +1,54 @@ -/* - case-files v2 - This file contains parameters used for declaring/generating a customized rack frame. - - All dimensions are in millimetres (mm) unless stated otherwise. - - "_N" appended to a module is meant to denote that this module is a negative volume, and should only be used to - substract from other volumes. "_P" is meant to denote a positive value. Modules are positive by default. -*/ -include <./profiles.scad> - -// Manually set this variable to toggle profiles +// Manually set this variable to toggle rack profile profileName = "micro"; -profile = getProfile(profileName); -defaultLayerHeight = 0.3; +_profileConfigs = [ + ["default", [ + ["maxUnitWidth", 180], + ["maxUnitDepth", 180], + ["numRailScrews", 18], + ["screwDiff", 10], + ["mainRailScrewType", "m4"], + ["mainRailSideMountScrewType", "m4"], + ["rackFrameScrewType", "m3"], + ["baseRoundness", 5], + ]], + ["nano", [ + ["maxUnitWidth", 105], + ["maxUnitDepth", 105], + ["numRailScrews", 10] + ]], + ["micro", [ + ["maxUnitWidth", 180], + ["maxUnitDepth", 180], + ["numRailScrews", 18] + ]], + ["mini", [ + ["maxUnitWidth", 205], + ["maxUnitDepth", 205], + ["numRailScrews", 20] + ]] + ]; + +function _getConfigValueRaw(profile, varName) = profile[search([varName], profile)[0]][1]; +function _getProfileRaw(profileName) = _profileConfigs[search([profileName], _profileConfigs)[0]][1]; + +function _getConfigValueOrThrowError(val) = val == undef? assert(false, "blah") 0: val; +function _getConfigValueOrDefault(val, default) = val == undef? default: val; + +function getConfigValue(profile, varName) = +_getConfigValueOrDefault( +_getConfigValueRaw(profile, varName), +_getConfigValueOrThrowError(_getConfigValueRaw(getProfile("default"), varName)) +); + +function getProfile(profileName) = _getConfigValueOrThrowError(_getProfileRaw(profileName)); function getConfig(name) = getConfigValue(profile, name); +profile = getProfile(profileName); + // Maximum width for rack-mount units. Change this according your max expected enclosure width. // Changing this will directly affect the required build volume. maxUnitWidth = getConfig("maxUnitWidth"); diff --git a/helper/slack.scad b/config/slack.scad similarity index 99% rename from helper/slack.scad rename to config/slack.scad index e229516..39372a3 100644 --- a/helper/slack.scad +++ b/config/slack.scad @@ -23,6 +23,5 @@ overhangSlack = 0.4; supportedOverhangSlack = 0.4; - // special slack cases, change if neccessary xBarYBarDovetailSlack = xySlack; \ No newline at end of file diff --git a/helper/apply.scad b/helper/apply.scad new file mode 100644 index 0000000..943069d --- /dev/null +++ b/helper/apply.scad @@ -0,0 +1,35 @@ +// Modules for apply pattern + +module apply_p() { + union() { + children(0); + children(1); + } +} + +module apply_n() { + difference() { + children(1); + children(0); + } +} + +module apply_pn() { + difference() { + union() { + children(0); + children(2); + } + children(1); + } +} + +module apply_np() { + difference() { + union() { + children(1); + children(2); + } + children(0); + } +} \ No newline at end of file diff --git a/helper/common.scad b/helper/common.scad index 81298f8..0879b14 100644 --- a/helper/common.scad +++ b/helper/common.scad @@ -1,47 +1,10 @@ +// Helper aggregator -/* Some commonly used variables plus functions -*/ - -$fn=64; -// TODO move these to math -eps=0.0001; - -inf10 = 10; -inf50 = 50; -inf1000 = 1000; -inf = inf1000; - - -module apply_p() { - union() { - children(0); - children(1); - } -} - -module apply_n() { - difference() { - children(1); - children(0); - } -} - -module apply_pn() { - difference() { - union() { - children(0); - children(2); - } - children(1); - } -} - -module apply_np() { - difference() { - union() { - children(1); - children(2); - } - children(0); - } -} \ No newline at end of file +include <./apply.scad> +include <./dovetail.scad> +include <./filet.scad> +include <./keystone.scad> +include <./math.scad> +include <./matrix.scad> +include <./screws.scad> +include <./sine.scad> diff --git a/helper/cylindricalFilet.scad b/helper/cylindricalFilet.scad deleted file mode 100644 index 7a04feb..0000000 --- a/helper/cylindricalFilet.scad +++ /dev/null @@ -1,16 +0,0 @@ - -module cylindricalFiletEdge(width, depth, height, roundness) { - rd = roundness; - - intersection() { - minkowski() { - rotate(a = [90, 0, 0]) - cylinder(r = rd, h = eps); - - translate(v = [rd, 0, rd]) - cube(size = [width, depth, height]); - } - - cube(size = [width, depth, height]); - } -} \ No newline at end of file diff --git a/helper/dovetail.scad b/helper/dovetail.scad index d3ff8de..1d08f3a 100644 --- a/helper/dovetail.scad +++ b/helper/dovetail.scad @@ -1,4 +1,4 @@ -include <./common.scad> +include <./math.scad> // centered on z axis module dovetail( diff --git a/helper/filet.scad b/helper/filet.scad index efb1920..350181f 100644 --- a/helper/filet.scad +++ b/helper/filet.scad @@ -1,12 +1,40 @@ -include <./halfspace.scad> include <./math.scad> -// Some modules for simple subtractive filets +module sphericalFiletEdge(width, depth, height, roundness) { + rd = roundness; + + intersection() { + minkowski() { + sphere(r = rd); + + translate(v = [rd, rd, rd]) + cube(size = [width*2, depth - 2*rd, height*2]); + } + + cube(size = [width, depth, height]); + } +} + +module cylindricalFiletEdge(width, depth, height, roundness) { + rd = roundness; + + intersection() { + minkowski() { + rotate(a = [90, 0, 0]) + cylinder(r = rd, h = eps); + + translate(v = [rd, 0, rd]) + cube(size = [width, depth, height]); + } + + cube(size = [width, depth, height]); + } +} module cylindricalFiletNegative(p0, p1, n, r) { l = norm(p1-p0); - align_to(p0=p0, p1=p1, p2=p0-n) + alignTo(p0=p0, p1=p1, p2=p0-n) rotate(a=[45,0,0]) rotate(a=[0,90,0]) zFiletNegative(length = l, r = r); diff --git a/helper/halfspace.scad b/helper/halfspace.scad deleted file mode 100644 index 90e10a1..0000000 --- a/helper/halfspace.scad +++ /dev/null @@ -1,26 +0,0 @@ -include <./common.scad> - -module halfspace(vpos, p) { - - ref = [0,0,-1]; - - if (cross(ref, vpos) == [0,0,0]) { - translate(p) - translate(v=[0,0, (ref*vpos) * -inf/2]) - cube(size=[inf, inf, inf], center=true); - } else { - translate(p) - alignPlanar(a=ref, b = vpos) - translate(v = [0, 0, -inf/2]) - cube(size = [inf, inf, inf], center = true); - } - -} - -module alignPlanar(a,b) { - rot_axis = cross(a,b); - angle = acos(a*b/(norm(a)*norm(b))); - - rotate(v=rot_axis, a=angle) - children(0); -} \ No newline at end of file diff --git a/helper/math.scad b/helper/math.scad index 402682c..62235ec 100644 --- a/helper/math.scad +++ b/helper/math.scad @@ -1,11 +1,20 @@ -// TODO remove/rename this file -/* Example usage: -for (i=mirror4XY(midpoint=[0,0,0], offsetX=90, offsetY=90)) { - translate(v=i) - something(); -} -*/ +// Some misc math-y utils +$fn=64; +eps=0.0001; +inf10 = 10; +inf50 = 50; +inf1000 = 1000; +inf = inf1000; + +function unit(v) = v/norm(v); + +function lerp(a, b, t) = (b * t + a * (1 - t)); + +/* Example usage: +for (i=mirror4XY(midpoint=[0,0,0], offsetX=90, offsetY=90)) + { translate(v=i) something(); } +*/ module mirror4XY(p, dx, dy) { px = p[0]; @@ -24,20 +33,18 @@ module mirror4XY(p, dx, dy) { children(0); } -// Generate a 4x4 matrix that causes a change of basis -// such that the origin is at point p0, the x axis is aligned -// from p0 to p1 and point p2 is in the first quadrant. -// Copied and pasted from https://trmm.net/Basis/ -module align_to(p0,p1,p2) { +/* Generate a 4x4 matrix that causes a change of basis +such that the origin is at point p0, the x axis is aligned +from p0 to p1 and point p2 is in the first quadrant. +Copied and pasted from https://trmm.net/Basis/ +*/ +module alignTo(p0,p1,p2) { x = unit(p1-p0); yp = unit(p2-p0); z = unit(cross(x,yp)); y = unit(cross(z,x)); - echo(p0,p1,p2); - echo(x,y,z); - multmatrix([ [x[0], y[0], z[0], p0[0]], [x[1], y[1], z[1], p0[1]], @@ -47,5 +54,27 @@ module align_to(p0,p1,p2) { children(); } -function unit(v) = v/norm(v); -function lerp(a, b, t) = (b * t + a * (1 - t)); +module halfspace(vpos, p) { + + ref = [0,0,-1]; + + if (cross(ref, vpos) == [0,0,0]) { + translate(p) + translate(v=[0,0, (ref*vpos) * -inf/2]) + cube(size=[inf, inf, inf], center=true); + } else { + translate(p) + alignPlanar(a=ref, b = vpos) + translate(v = [0, 0, -inf/2]) + cube(size = [inf, inf, inf], center = true); + } + +} + +module alignPlanar(a,b) { + rot_axis = cross(a,b); + angle = acos(a*b/(norm(a)*norm(b))); + + rotate(v=rot_axis, a=angle) + children(0); +} \ No newline at end of file diff --git a/helper/screws.scad b/helper/screws.scad index 0ec2808..6322050 100644 --- a/helper/screws.scad +++ b/helper/screws.scad @@ -1,7 +1,6 @@ /* Some common screw dimensions and helper functions/modules */ include <./math.scad> -include <./common.scad> /********************************************************************************/ // M3 dimensions diff --git a/helper/sinusoid.scad b/helper/sine.scad similarity index 95% rename from helper/sinusoid.scad rename to helper/sine.scad index 431a935..b964846 100644 --- a/helper/sinusoid.scad +++ b/helper/sine.scad @@ -57,6 +57,3 @@ module sineWaveHull(length, resolution, amplitudeFunction, period, shift, hullDi } } } - - -//sineWaveHull(length, resolution, amplitudeFunction, period, shift, 10); \ No newline at end of file diff --git a/helper/sphericalFilet.scad b/helper/sphericalFilet.scad deleted file mode 100644 index da78faf..0000000 --- a/helper/sphericalFilet.scad +++ /dev/null @@ -1,15 +0,0 @@ - -module sphericalFiletEdge(width, depth, height, roundness) { - rd = roundness; - - intersection() { - minkowski() { - sphere(r = rd); - - translate(v = [rd, rd, rd]) - cube(size = [width*2, depth - 2*rd, height*2]); - } - - cube(size = [width, depth, height]); - } -} diff --git a/helper/voronoi.scad b/helper/voronoi.scad deleted file mode 100644 index 011f8eb..0000000 --- a/helper/voronoi.scad +++ /dev/null @@ -1,95 +0,0 @@ - -// (c)2013 Felipe Sanches -// licensed under the terms of the GNU GPL version 3 (or later) - -function normalize(v) = v / (sqrt(v[0] * v[0] + v[1] * v[1])); - -// -// The voronoi() function generates a 2D surface, which can be provided to -// a) linear_extrude() to produce a 3D object -// b) intersection() to restrict it to a a specified shape -- see voronoi_polygon.scad -// -// Parameters: -// points (required) ... nuclei coordinates (array of [x, y] pairs) -// L ... the radius of the "world" (the pattern is built within this circle) -// thickness ... the thickness of the lines between cells -// round ... the radius applied to corners (fillet in CAD terms) -// nuclei (bool) ... show nuclei sites -// -// These parameters need to be kept more or less in proportion to each other, and to the distance -// apart of points in the point_set. If one or the other parameter is increased or decreased too -// much, you'll get no output. -// -module voronoi(points, L = 200, thickness = 1, round = 6, nuclei = true) { - for (p = points) { - difference() { - minkowski() { - intersection_for(p1 = points){ - if (p != p1) { - angle = 90 + atan2(p[1] - p1[1], p[0] - p1[0]); - - translate((p + p1) / 2 - normalize(p1 - p) * (thickness + round)) - rotate([0, 0, angle]) - translate([-L, -L]) - square([2 * L, L]); - } - } - circle(r = round, $fn = 20); - } - if (nuclei) - translate(p) circle(r = 1, $fn = 20); - } - } -} - -// -// The random_voronoi() function is the helper wrapper over the voronoi() core. -// It generates random nuclei site coordinates into the square area, -// passing other arguments to voronoi() unchanged. -// -// Parameters: -// n ... number of nuclei sites to be generated -// nuclei (bool) ... show nuclei sites -// L ... the radius of the "world" (the pattern is built within this circle) -// thickness ... the thickness of the lines between cells -// round ... the radius applied to corners (fillet in CAD terms) -// min ... minimum x and y coordinate for nuclei generation -// max ... maximum x and y coordinate for nuclei generation -// seed ... seed for the random generator (random if undefined) -// center (bool) ... move resulting pattern to [0, 0] if true -// -module random_voronoi(n = 20, nuclei = true, L = 200, thickness = 1, round = 6, min = 0, max = 100, seed = undef, center = false) { - seed = seed == undef ? rands(0, 100, 1)[0] : seed; - echo("Seed", seed); - - // Generate points. - x = rands(min, max, n, seed); - y = rands(min, max, n, seed + 1); - points = [ for (i = [0 : n - 1]) [x[i], y[i]] ]; - - // Center Voronoi. - offset_x = center ? -(max(x) - min(x)) / 2 : 0; - offset_y = center ? -(max(y) - min(y)) / 2 : 0; - translate([offset_x, offset_y]) - - voronoi(points, L = L, thickness = thickness, round = round, nuclei = nuclei); -} - -// example with an explicit list of points: -point_set = [ - [0, 0], [30, 0], [20, 10], [50, 20], [15, 30], [85, 30], [35, 30], [12, 60], - [45, 50], [80, 80], [20, -40], [-20, 20], [-15, 10], [-15, 50] -]; -//voronoi(points = point_set, round = 4, nuclei = true); - -module voronoi3u_N(h) { - intersection() { - translate(v=[10,5,0]) - cube(size=[160, 10, h]); - translate(v=[20,-52,0]) - scale(v=[0.40,0.44,10]) - linear_extrude(height=10) - random_voronoi(n = 128, round = 10, min = 0, max = 300, seed = 40, thickness=3.5, nuclei=false); - } -} - diff --git a/rack/assemblyGuide.scad b/rack/assemblyGuide.scad index 0480e10..4dd1254 100644 --- a/rack/assemblyGuide.scad +++ b/rack/assemblyGuide.scad @@ -1,5 +1,5 @@ -include <../helper/math.scad> -include <./config.scad> +include <../helper/common.scad> +include <../config/common.scad> include <./mainRail.scad> include <./yBar.scad> include <./xBar.scad> @@ -12,6 +12,7 @@ include <./xyPlate.scad> include <../rack-mount/side-rail/dualMount.scad> +// TODO: this is completly broken. fix this and figure out a nice way to run this with cli commands assemblyInstructions(); module assemblyInstructions () { diff --git a/rack/connector/basePlateYBarConnectors.scad b/rack/connector/basePlateYBarConnectors.scad index 426489d..f4b9f13 100644 --- a/rack/connector/basePlateYBarConnectors.scad +++ b/rack/connector/basePlateYBarConnectors.scad @@ -1,14 +1,7 @@ -include <../../helper/screws.scad> include <../../helper/common.scad> -include <../../helper/matrix.scad> -include <../../helper/slack.scad> -include <../../helper/dovetail.scad> -include <../../helper/halfspace.scad> - +include <../../config/common.scad> include <../sharedVariables.scad> -include <../config.scad> - _mountX = 12; _mountY = 14; _mountZ = 10; diff --git a/rack/connector/connectors.scad b/rack/connector/connectors.scad index c3b3888..9070b64 100644 --- a/rack/connector/connectors.scad +++ b/rack/connector/connectors.scad @@ -1,14 +1,7 @@ -/* - Connector factory -*/ -include <../../helper/screws.scad> -include <../../helper/common.scad> -include <../../helper/matrix.scad> -include <../../helper/slack.scad> -include <../../helper/dovetail.scad> -include <../../helper/halfspace.scad> -include <../config.scad> +// Connector Aggregator and utils +include <../../helper/common.scad> +include <../../config/common.scad> include <./xBarYBarConnectors.scad> include <./mainRailYBarConnectors.scad> include <./sideModuleYBarConnectors.scad> diff --git a/rack/connector/mainRailYBarConnectors.scad b/rack/connector/mainRailYBarConnectors.scad index b475d41..00c7463 100644 --- a/rack/connector/mainRailYBarConnectors.scad +++ b/rack/connector/mainRailYBarConnectors.scad @@ -1,15 +1,7 @@ -include <../../helper/screws.scad> include <../../helper/common.scad> -include <../../helper/matrix.scad> -include <../../helper/halfspace.scad> -include <../../helper/slack.scad> -include <../../helper/dovetail.scad> -include <../../helper/halfspace.scad> - +include <../../config/common.scad> include <../sharedVariables.scad> -include <../config.scad> - mainRailHeatSetOnYBarDx = railSideMountThickness + 5; mainRailHeatSetOnYBarDy = railFrontThickness + 2; diff --git a/rack/connector/sideModuleYBarConnectors.scad b/rack/connector/sideModuleYBarConnectors.scad index 6e69987..4141898 100644 --- a/rack/connector/sideModuleYBarConnectors.scad +++ b/rack/connector/sideModuleYBarConnectors.scad @@ -1,12 +1,7 @@ -include <../../helper/screws.scad> include <../../helper/common.scad> -include <../../helper/matrix.scad> -include <../../helper/slack.scad> -include <../../helper/dovetail.scad> -include <../../helper/halfspace.scad> +include <../../config/common.scad> include <../sharedVariables.scad> include <../side/sideWallVariables.scad> -include <../config.scad> module onYBarSideModuleNegative() { diff --git a/rack/connector/stackYBarConnectors.scad b/rack/connector/stackYBarConnectors.scad index 4b21cb3..2cf1360 100644 --- a/rack/connector/stackYBarConnectors.scad +++ b/rack/connector/stackYBarConnectors.scad @@ -1,13 +1,7 @@ -include <../../helper/screws.scad> include <../../helper/common.scad> -include <../../helper/matrix.scad> -include <../../helper/slack.scad> -include <../../helper/dovetail.scad> -include <../../helper/halfspace.scad> - +include <../../config/common.scad> include <../sharedVariables.scad> -include <../config.scad> connectorYEdgeToYBarYEdge = 5; connectorXEdgeToYBarXEdge = 5; diff --git a/rack/connector/xBarYBarConnectors.scad b/rack/connector/xBarYBarConnectors.scad index 31666da..c9b917c 100644 --- a/rack/connector/xBarYBarConnectors.scad +++ b/rack/connector/xBarYBarConnectors.scad @@ -1,14 +1,7 @@ -include <../../helper/screws.scad> include <../../helper/common.scad> -include <../../helper/matrix.scad> -include <../../helper/slack.scad> -include <../../helper/dovetail.scad> -include <../../helper/halfspace.scad> - +include <../../config/common.scad> include <../sharedVariables.scad> -include <../config.scad> - // On xBar module onXBarToYBarNegative() { y = 27; diff --git a/rack/mainRail.scad b/rack/mainRail.scad index cc980f7..d9fdb4a 100644 --- a/rack/mainRail.scad +++ b/rack/mainRail.scad @@ -1,15 +1,9 @@ -include <./config.scad> -include <../helper/screws.scad> -include <../helper/filet.scad> -include <../helper/slack.scad> -include <../helper/math.scad> -include <../helper/halfspace.scad> +include <../helper/common.scad> +include <../config/common.scad> include <./sharedVariables.scad> -include <../helper/matrix.scad> - include <./connector/connectors.scad> -*mainRail(); +mainRail(); module mainRail() { diff --git a/rack/print/eval_P.scad b/rack/print/eval_P.scad index a86ed3e..57f115e 100644 --- a/rack/print/eval_P.scad +++ b/rack/print/eval_P.scad @@ -1,6 +1,7 @@ -include <../xBar.scad> -include <../yBar.scad> -include <../mainRail.scad> +include <../sharedVariables.scad> +use <../xBar.scad> +use <../yBar.scad> +use <../mainRail.scad> // Evaluation print for slack config, please see slack.scad // to configure tolerances diff --git a/rack/print/hingeModule_P1.scad b/rack/print/hingeModule_P1.scad index f9933e5..08593b1 100644 --- a/rack/print/hingeModule_P1.scad +++ b/rack/print/hingeModule_P1.scad @@ -1,4 +1,4 @@ -include <../side/hingeModule.scad> +use <../side/hingeModule.scad> // Oriented for 3d printing. // Supports generally not required (? need to print to test) diff --git a/rack/print/magnetModule_P1.scad b/rack/print/magnetModule_P1.scad index a21a970..29b4e9d 100644 --- a/rack/print/magnetModule_P1.scad +++ b/rack/print/magnetModule_P1.scad @@ -1,4 +1,4 @@ -include <../side/magnetModule.scad> +use <../side/magnetModule.scad> // Oriented for 3d printing. // Supports generally not required (? need to print to test) diff --git a/rack/print/magnetModule_P2.scad b/rack/print/magnetModule_P2.scad index aabb3e1..3025957 100644 --- a/rack/print/magnetModule_P2.scad +++ b/rack/print/magnetModule_P2.scad @@ -1,4 +1,4 @@ -include <../side/magnetModule.scad> +use <../side/magnetModule.scad> // Oriented for 3d printing. // Supports generally not required (? need to print to test) diff --git a/rack/print/mainRail_P.scad b/rack/print/mainRail_P.scad index e739c4e..1e1d3c6 100644 --- a/rack/print/mainRail_P.scad +++ b/rack/print/mainRail_P.scad @@ -1,11 +1,12 @@ -include <../mainRail.scad> +include <../sharedVariables.scad> + +use <../mainRail.scad> // Oriented for 3d printing. // Supports not required. multmatrix(mainRailPrintOrientation) mainRail(); - mainRailPrintOrientation = [ [cos(-90), 0, sin(-90), railTotalHeight], [0, 1, 0, 0 ], diff --git a/rack/print/sideWallLeft_P.scad b/rack/print/sideWallLeft_P.scad index b74183d..92f2d28 100644 --- a/rack/print/sideWallLeft_P.scad +++ b/rack/print/sideWallLeft_P.scad @@ -1,4 +1,4 @@ -include <../side/sideWallLeft.scad> +use <../side/sideWallLeft.scad> // Oriented for 3d printing. // Supports generally not required (? need to print to test), but a brim is recommended diff --git a/rack/print/sideWallRight_P.scad b/rack/print/sideWallRight_P.scad index f8660b3..ff03b3e 100644 --- a/rack/print/sideWallRight_P.scad +++ b/rack/print/sideWallRight_P.scad @@ -1,4 +1,4 @@ -include <../side/sideWallRight.scad> +use <../side/sideWallRight.scad> // Oriented for 3d printing. // Supports generally not required (? need to print to test), but a brim is recommended diff --git a/rack/print/xBar_P.scad b/rack/print/xBar_P.scad index 5a0e56f..3cf1a35 100644 --- a/rack/print/xBar_P.scad +++ b/rack/print/xBar_P.scad @@ -1,4 +1,4 @@ -include <../xBar.scad> +use <../xBar.scad> // Oriented for 3d printing. // Supports generally not required: depending on roundness. diff --git a/rack/print/xyPlate_P.scad b/rack/print/xyPlate_P.scad index 3f63861..b2b7305 100644 --- a/rack/print/xyPlate_P.scad +++ b/rack/print/xyPlate_P.scad @@ -1,4 +1,4 @@ -include <../xyPlate.scad> +use <../xyPlate.scad> // Oriented for 3d printing. // Supports generally not required. diff --git a/rack/print/yBar_P.scad b/rack/print/yBar_P.scad index 3e14161..bbbfc91 100644 --- a/rack/print/yBar_P.scad +++ b/rack/print/yBar_P.scad @@ -1,16 +1,5 @@ -include <../yBar.scad> - -include <../xBar.scad> +use <../yBar.scad> // Oriented for 3d printing. // Supports required at XY wall connections, and depending on roundness yBar(); - - -*difference() { - translate(v=[2,0,0]) - cube(size=[16,10,6], center=true); - hexNutPocket_N("m3", openSide = false, backSpace = 5, bridgeFront = true); -} - -*hexNutPocket_N("m3", openSide = false, backSpace = 5, bridgeBack = true); \ No newline at end of file diff --git a/rack/profiles.scad b/rack/profiles.scad deleted file mode 100644 index 6967876..0000000 --- a/rack/profiles.scad +++ /dev/null @@ -1,53 +0,0 @@ -/* - case-files v2 - This file contains - Example usage: - - profileName = "mini"; - varName = "mainRailSideMountScrewType"; - - profile = getProfile(profileName); - echo("val:", getConfigValue(profile, varName)); - */ - -_profileConfigs = [ - ["default", [ - ["maxUnitWidth", 180], - ["maxUnitDepth", 180], - ["numRailScrews", 18], - ["screwDiff", 10], - ["mainRailScrewType", "m4"], - ["mainRailSideMountScrewType", "m4"], - ["rackFrameScrewType", "m3"], - ["baseRoundness", 5], - ]], - ["nano", [ - ["maxUnitWidth", 105], - ["maxUnitDepth", 105], - ["numRailScrews", 10] - ]], - ["micro", [ - ["maxUnitWidth", 180], - ["maxUnitDepth", 180], - ["numRailScrews", 18] - ]], - ["mini", [ - ["maxUnitWidth", 205], - ["maxUnitDepth", 205], - ["numRailScrews", 20] - ]] - ]; - -function _getConfigValueRaw(profile, varName) = profile[search([varName], profile)[0]][1]; -function _getProfileRaw(profileName) = _profileConfigs[search([profileName], _profileConfigs)[0]][1]; - -function _getConfigValueOrThrowError(val) = val == undef? assert(false, "blah") 0: val; -function _getConfigValueOrDefault(val, default) = val == undef? default: val; - -function getConfigValue(profile, varName) = - _getConfigValueOrDefault( - _getConfigValueRaw(profile, varName), - _getConfigValueOrThrowError(_getConfigValueRaw(getProfile("default"), varName)) - ); - -function getProfile(profileName) = _getConfigValueOrThrowError(_getProfileRaw(profileName)); diff --git a/rack/sharedVariables.scad b/rack/sharedVariables.scad index 73881a3..f4e27a1 100644 --- a/rack/sharedVariables.scad +++ b/rack/sharedVariables.scad @@ -1,4 +1,4 @@ -include <./config.scad> +include <../config/common.scad> // Main rail variables: diff --git a/rack/side/hingeModule.scad b/rack/side/hingeModule.scad index ca99927..fa7d1db 100644 --- a/rack/side/hingeModule.scad +++ b/rack/side/hingeModule.scad @@ -1,11 +1,10 @@ -include <../config.scad> -include <./sideWallVariables.scad> +include <../../helper/common.scad> +include <../../config/common.scad> include <../sharedVariables.scad> -include <../../helper/halfspace.scad> -include <../../helper/screws.scad> +include <./sideWallVariables.scad> translate(v=[10,20,-2 - sideWallZHingeTotalClearance]) -*hingeModule(); +hingeModule(); module hingeModule() { diff --git a/rack/side/magnetModule.scad b/rack/side/magnetModule.scad index ef88f82..97d1c32 100644 --- a/rack/side/magnetModule.scad +++ b/rack/side/magnetModule.scad @@ -1,13 +1,10 @@ - -include <../config.scad> -include <./sideWallVariables.scad> +include <../../helper/common.scad> +include <../../config/common.scad> include <../sharedVariables.scad> -include <../../helper/halfspace.scad> -include <../../helper/magnet.scad> -include <../../helper/screws.scad> +include <./sideWallVariables.scad> translate(v=[10,-5,-(2+sideWallZHingeTotalClearance)]) -*magnetModule(); +magnetModule(); magnetModuleMagnetMountDy = magnetMountToYBarFront - sideWallSlotToXZ; magnetModuleMagnetMountDz = magnetMountToYBarTop + sideWallConnLugDepression; diff --git a/rack/side/sideWallBase.scad b/rack/side/sideWallBase.scad index d9b8c92..9fc3196 100644 --- a/rack/side/sideWallBase.scad +++ b/rack/side/sideWallBase.scad @@ -1,19 +1,11 @@ -include <../../helper/math.scad> -include <../../helper/halfspace.scad> -include <../../helper/magnet.scad> -include <../../helper/slack.scad> -include <../config.scad> - +include <../../helper/common.scad> +include <../../config/common.scad> +include <../sharedVariables.scad> include <./sideWallMagnetMount.scad> include <./sideWallVariables.scad> -include <../sharedVariables.scad> - include <./magnetModule.scad> include <./hingeModule.scad> -//echo("Side Wall Height", sideWallZ); -//echo("Side Wall Depth", sideWallY); - //translate(v = [hingePoleDx ,hingePoleDy, 10]) //rotate(a=[0,0,-120]) //translate(v = [-hingePoleDx ,-hingePoleDy, 0]) diff --git a/rack/side/sideWallLeft.scad b/rack/side/sideWallLeft.scad index 802cf5a..0d0738b 100644 --- a/rack/side/sideWallLeft.scad +++ b/rack/side/sideWallLeft.scad @@ -1,6 +1,6 @@ include <./sideWallBase.scad> -*sideWallLeft(); +sideWallLeft(); module sideWallLeft() { diff --git a/rack/side/sideWallMagnetMount.scad b/rack/side/sideWallMagnetMount.scad index d29fa95..ed71cea 100644 --- a/rack/side/sideWallMagnetMount.scad +++ b/rack/side/sideWallMagnetMount.scad @@ -1,9 +1,7 @@ - -include <../config.scad> -include <./sideWallVariables.scad> +include <../../helper/common.scad> +include <../../config/common.scad> include <../sharedVariables.scad> -include <../../helper/halfspace.scad> -include <../../helper/magnet.scad> +include <./sideWallVariables.scad> module sideWallMagnetMount() { // oriented so that the xy face is the side wall's inner face diff --git a/rack/side/sideWallRight.scad b/rack/side/sideWallRight.scad index 15a3d5d..2376fa1 100644 --- a/rack/side/sideWallRight.scad +++ b/rack/side/sideWallRight.scad @@ -1,6 +1,6 @@ include <./sideWallBase.scad> -*sideWallRight(); +sideWallRight(); module sideWallRight() { diff --git a/rack/side/sideWallVariables.scad b/rack/side/sideWallVariables.scad index 595ec31..060f6c0 100644 --- a/rack/side/sideWallVariables.scad +++ b/rack/side/sideWallVariables.scad @@ -1,9 +1,6 @@ +include <../../helper/common.scad> +include <../../config/common.scad> -include <../config.scad> -include <../sharedVariables.scad> -include <../../helper/magnet.scad> -include <../../helper/slack.scad> -include <../../helper/dowel.scad> sideWallConnW = 7; sideWallConnD = 20; diff --git a/rack/stackEnds.scad b/rack/stackEnds.scad index 43a52ed..d1ffa72 100644 --- a/rack/stackEnds.scad +++ b/rack/stackEnds.scad @@ -1,5 +1,4 @@ -include <../helper/halfspace.scad> -include <../helper/slack.scad> +include <../helper/common.scad> include <./sharedVariables.scad> include <./connector/connectors.scad> diff --git a/rack/xBar.scad b/rack/xBar.scad index b4a3a26..f3032d4 100644 --- a/rack/xBar.scad +++ b/rack/xBar.scad @@ -1,13 +1,9 @@ -include <../helper/cylindricalFilet.scad> -include <../helper/filet.scad> -include <../helper/screws.scad> -include <../helper/matrix.scad> - -include <./config.scad> +include <../helper/common.scad> +include <../config/common.scad> include <./sharedVariables.scad> include <./connector/connectors.scad> -*xBar(); +xBar(); module xBar() { diff --git a/rack/xyPlate.scad b/rack/xyPlate.scad index a1393fa..487cbc2 100644 --- a/rack/xyPlate.scad +++ b/rack/xyPlate.scad @@ -1,10 +1,7 @@ -include <../helper/slack.scad> -include <./yBar.scad> -include <./xBar.scad> +include <../helper/common.scad> include <./connector/connectors.scad> -*xyPlate(); - +xyPlate(); xyPlateConnDx = xBarX + 2*_heatSetX; // X distance between connectors xyPlateConnDy = yBarDepth - 2*basePlateScrewMountToYBarXZFace; // Y distance between connectors diff --git a/rack/yBar.scad b/rack/yBar.scad index 5f03c8f..42ea080 100644 --- a/rack/yBar.scad +++ b/rack/yBar.scad @@ -1,16 +1,9 @@ -include <../helper/math.scad> -include <../helper/matrix.scad> -include <../helper/sphericalFilet.scad> -include <../helper/cylindricalFilet.scad> -include <../helper/screws.scad> -include <../helper/magnet.scad> -include <./config.scad> -include <./mainRail.scad> - +include <../helper/common.scad> +include <../config/common.scad> include <./connector/connectors.scad> include <./sharedVariables.scad> -*yBar(); +yBar(); module yBar() { diff --git a/resource/sbc/rpi/frontPlate.scad b/resource/sbc/rpi/frontPlate.scad index 59df78b..a17586a 100644 --- a/resource/sbc/rpi/frontPlate.scad +++ b/resource/sbc/rpi/frontPlate.scad @@ -1,6 +1,6 @@ include <../common.scad> include <../rack/screws.scad> -include <../sinusoid.scad> +include <../sine.scad> vU = 2; uHeight = 10; diff --git a/stl/micro/rack-mount/dualLBracketSupportRail_P1.stl b/stl/micro/rack-mount/dualLBracketSupportRail_P1.stl index 78512d6..cfb2dc2 100644 Binary files a/stl/micro/rack-mount/dualLBracketSupportRail_P1.stl and b/stl/micro/rack-mount/dualLBracketSupportRail_P1.stl differ diff --git a/stl/micro/rack-mount/dualLBracketSupportRail_P2.stl b/stl/micro/rack-mount/dualLBracketSupportRail_P2.stl index fe5377b..35810ee 100644 Binary files a/stl/micro/rack-mount/dualLBracketSupportRail_P2.stl and b/stl/micro/rack-mount/dualLBracketSupportRail_P2.stl differ diff --git a/stl/micro/rack/eval_P.stl b/stl/micro/rack/eval_P.stl index 2d2a370..d3112d6 100644 Binary files a/stl/micro/rack/eval_P.stl and b/stl/micro/rack/eval_P.stl differ diff --git a/stl/micro/rack/hingeModule_P1.stl b/stl/micro/rack/hingeModule_P1.stl index d14ab45..de2545f 100644 Binary files a/stl/micro/rack/hingeModule_P1.stl and b/stl/micro/rack/hingeModule_P1.stl differ diff --git a/stl/micro/rack/magnetModule_P1.stl b/stl/micro/rack/magnetModule_P1.stl index 3d1e29c..2cd50a8 100644 Binary files a/stl/micro/rack/magnetModule_P1.stl and b/stl/micro/rack/magnetModule_P1.stl differ diff --git a/stl/micro/rack/magnetModule_P2.stl b/stl/micro/rack/magnetModule_P2.stl index f06b99a..26d6cf7 100644 Binary files a/stl/micro/rack/magnetModule_P2.stl and b/stl/micro/rack/magnetModule_P2.stl differ diff --git a/stl/micro/rack/mainRail_P.stl b/stl/micro/rack/mainRail_P.stl index 9c8183f..6b4f2f7 100644 Binary files a/stl/micro/rack/mainRail_P.stl and b/stl/micro/rack/mainRail_P.stl differ diff --git a/stl/micro/rack/sideWallLeft_P.stl b/stl/micro/rack/sideWallLeft_P.stl index acd0724..8fe829a 100644 Binary files a/stl/micro/rack/sideWallLeft_P.stl and b/stl/micro/rack/sideWallLeft_P.stl differ diff --git a/stl/micro/rack/sideWallRight_P.stl b/stl/micro/rack/sideWallRight_P.stl index 891f4cf..370a7bd 100644 Binary files a/stl/micro/rack/sideWallRight_P.stl and b/stl/micro/rack/sideWallRight_P.stl differ diff --git a/stl/micro/rack/xBar_P.stl b/stl/micro/rack/xBar_P.stl index 7ae3337..899eda9 100644 Binary files a/stl/micro/rack/xBar_P.stl and b/stl/micro/rack/xBar_P.stl differ diff --git a/stl/micro/rack/xyPlate_P.stl b/stl/micro/rack/xyPlate_P.stl index c033b53..a7f8b85 100644 Binary files a/stl/micro/rack/xyPlate_P.stl and b/stl/micro/rack/xyPlate_P.stl differ diff --git a/stl/micro/rack/yBar_P.stl b/stl/micro/rack/yBar_P.stl index 8d3256b..11ce9d5 100644 Binary files a/stl/micro/rack/yBar_P.stl and b/stl/micro/rack/yBar_P.stl differ diff --git a/stl/mini/rack-mount/dualLBracketSupportRail_P1.stl b/stl/mini/rack-mount/dualLBracketSupportRail_P1.stl index 8f57919..e867f40 100644 Binary files a/stl/mini/rack-mount/dualLBracketSupportRail_P1.stl and b/stl/mini/rack-mount/dualLBracketSupportRail_P1.stl differ diff --git a/stl/mini/rack-mount/dualLBracketSupportRail_P2.stl b/stl/mini/rack-mount/dualLBracketSupportRail_P2.stl index 2f749a6..ae8956c 100644 Binary files a/stl/mini/rack-mount/dualLBracketSupportRail_P2.stl and b/stl/mini/rack-mount/dualLBracketSupportRail_P2.stl differ diff --git a/stl/mini/rack/eval_P.stl b/stl/mini/rack/eval_P.stl index 427db31..e84c7f0 100644 Binary files a/stl/mini/rack/eval_P.stl and b/stl/mini/rack/eval_P.stl differ diff --git a/stl/mini/rack/hingeModule_P1.stl b/stl/mini/rack/hingeModule_P1.stl index d14ab45..de2545f 100644 Binary files a/stl/mini/rack/hingeModule_P1.stl and b/stl/mini/rack/hingeModule_P1.stl differ diff --git a/stl/mini/rack/magnetModule_P1.stl b/stl/mini/rack/magnetModule_P1.stl index 3d1e29c..2cd50a8 100644 Binary files a/stl/mini/rack/magnetModule_P1.stl and b/stl/mini/rack/magnetModule_P1.stl differ diff --git a/stl/mini/rack/magnetModule_P2.stl b/stl/mini/rack/magnetModule_P2.stl index f06b99a..26d6cf7 100644 Binary files a/stl/mini/rack/magnetModule_P2.stl and b/stl/mini/rack/magnetModule_P2.stl differ diff --git a/stl/mini/rack/mainRail_P.stl b/stl/mini/rack/mainRail_P.stl index 350d04c..fc50746 100644 Binary files a/stl/mini/rack/mainRail_P.stl and b/stl/mini/rack/mainRail_P.stl differ diff --git a/stl/mini/rack/sideWallLeft_P.stl b/stl/mini/rack/sideWallLeft_P.stl index 5c96586..a1bd655 100644 Binary files a/stl/mini/rack/sideWallLeft_P.stl and b/stl/mini/rack/sideWallLeft_P.stl differ diff --git a/stl/mini/rack/sideWallRight_P.stl b/stl/mini/rack/sideWallRight_P.stl index 5888ece..9c97af7 100644 Binary files a/stl/mini/rack/sideWallRight_P.stl and b/stl/mini/rack/sideWallRight_P.stl differ diff --git a/stl/mini/rack/xBar_P.stl b/stl/mini/rack/xBar_P.stl index 3eacb05..6e3ea00 100644 Binary files a/stl/mini/rack/xBar_P.stl and b/stl/mini/rack/xBar_P.stl differ diff --git a/stl/mini/rack/xyPlate_P.stl b/stl/mini/rack/xyPlate_P.stl index c7bed3b..d6aee6f 100644 Binary files a/stl/mini/rack/xyPlate_P.stl and b/stl/mini/rack/xyPlate_P.stl differ diff --git a/stl/mini/rack/yBar_P.stl b/stl/mini/rack/yBar_P.stl index 0f43a52..2e3bbea 100644 Binary files a/stl/mini/rack/yBar_P.stl and b/stl/mini/rack/yBar_P.stl differ diff --git a/stl/nano/rack-mount/dualLBracketSupportRail_P1.stl b/stl/nano/rack-mount/dualLBracketSupportRail_P1.stl index 6897798..62848a6 100644 Binary files a/stl/nano/rack-mount/dualLBracketSupportRail_P1.stl and b/stl/nano/rack-mount/dualLBracketSupportRail_P1.stl differ diff --git a/stl/nano/rack-mount/dualLBracketSupportRail_P2.stl b/stl/nano/rack-mount/dualLBracketSupportRail_P2.stl index 3ab394b..d3c5a1e 100644 Binary files a/stl/nano/rack-mount/dualLBracketSupportRail_P2.stl and b/stl/nano/rack-mount/dualLBracketSupportRail_P2.stl differ diff --git a/stl/nano/rack/eval_P.stl b/stl/nano/rack/eval_P.stl index 9a319bb..0510000 100644 Binary files a/stl/nano/rack/eval_P.stl and b/stl/nano/rack/eval_P.stl differ diff --git a/stl/nano/rack/hingeModule_P1.stl b/stl/nano/rack/hingeModule_P1.stl index d14ab45..de2545f 100644 Binary files a/stl/nano/rack/hingeModule_P1.stl and b/stl/nano/rack/hingeModule_P1.stl differ diff --git a/stl/nano/rack/magnetModule_P1.stl b/stl/nano/rack/magnetModule_P1.stl index 3d1e29c..2cd50a8 100644 Binary files a/stl/nano/rack/magnetModule_P1.stl and b/stl/nano/rack/magnetModule_P1.stl differ diff --git a/stl/nano/rack/magnetModule_P2.stl b/stl/nano/rack/magnetModule_P2.stl index f06b99a..26d6cf7 100644 Binary files a/stl/nano/rack/magnetModule_P2.stl and b/stl/nano/rack/magnetModule_P2.stl differ diff --git a/stl/nano/rack/mainRail_P.stl b/stl/nano/rack/mainRail_P.stl index 193f659..12331c2 100644 Binary files a/stl/nano/rack/mainRail_P.stl and b/stl/nano/rack/mainRail_P.stl differ diff --git a/stl/nano/rack/sideWallLeft_P.stl b/stl/nano/rack/sideWallLeft_P.stl index 544dc7e..8c1c926 100644 Binary files a/stl/nano/rack/sideWallLeft_P.stl and b/stl/nano/rack/sideWallLeft_P.stl differ diff --git a/stl/nano/rack/sideWallRight_P.stl b/stl/nano/rack/sideWallRight_P.stl index eb63ffa..1d342a2 100644 Binary files a/stl/nano/rack/sideWallRight_P.stl and b/stl/nano/rack/sideWallRight_P.stl differ diff --git a/stl/nano/rack/xBar_P.stl b/stl/nano/rack/xBar_P.stl index 0a0d97f..bafc13f 100644 Binary files a/stl/nano/rack/xBar_P.stl and b/stl/nano/rack/xBar_P.stl differ diff --git a/stl/nano/rack/xyPlate_P.stl b/stl/nano/rack/xyPlate_P.stl index 4c24a26..49b6bbd 100644 Binary files a/stl/nano/rack/xyPlate_P.stl and b/stl/nano/rack/xyPlate_P.stl differ diff --git a/stl/nano/rack/yBar_P.stl b/stl/nano/rack/yBar_P.stl index edf32b7..1286523 100644 Binary files a/stl/nano/rack/yBar_P.stl and b/stl/nano/rack/yBar_P.stl differ