# Design This file fixes the geometry. How the model's code is organised is up to you. ## Sizes All in millimetres. Write `L`, `W`, `H` for the inside length, width and height, `t` for `wall` and `r` for `corner_radius`. | | Length (X) | Width (Y) | Height (Z) | | --- | --- | --- | --- | | Base | `L + 2t` | `W + 2t` | `H + t` | | Lid, as printed | `L + 2t` | `W + 2t` | `t + 3` | | Closed | `L + 2t` | `W + 2t` | `H + 2t` | At the defaults: the base is 104.8 by 64.8 by 32.4, the lid 104.8 by 64.8 by 5.4, and the closed box 34.8 high. ## Volumes The area of a rectangle `a` by `b` with corners of radius `c`: ``` area(a, b, c) = a * b - (4 - pi) * c * c ``` ``` shell = area(L + 2t, W + 2t, r) * (H + t) - area(L, W, max(r - t, 0)) * H standoffs = 4 * (pi / 4) * (6 * 6 - 2.5 * 2.5) * 5 slot = 12 * 7 * t base = shell + standoffs (if on) - slot (if on) plate = area(L + 2t, W + 2t, r) * t lip = ( area(L - 0.4, W - 0.4, max(r - t - 0.2, 0)) - area(L - 3.6, W - 3.6, 0) ) * 3 lid = plate + lip ``` At the defaults, in cubic millimetres, to the nearest one: | Part | Volume | | --- | --- | | Base, no standoffs, no cable slot | 39,651 | | Base, with 4 standoffs | 40,118 | | Base, with 4 standoffs and the cable slot | 39,916 | | Lid | 17,758 | A measured volume passes when it is within 0.5% of the formula. A bounding box passes when each side is within 0.05. ## Where things are | Feature | Position | | --- | --- | | Standoff centres | `X = +/-(L/2 - 5)`, `Y = +/-(W/2 - 5)`; at the defaults `(+/-45, +/-25)` | | Standoffs | From `Z = t` to `Z = t + 5` | | Cable slot | In the wall at `X = +L/2`, from `Y = -6` to `Y = +6`, from `Z = H + t - 7` up | | Lip, lid as printed | From `Z = t` to `Z = t + 3` | ## How to model it - Draw each outline in 2D as a rounded rectangle and extrude it. Rounding edges of a 3D box afterwards rounds edges this spec leaves sharp. - Keep every number in one place at the top of the source, read from the inputs. - With `tool` set to `openscad`, set `$fn` from the largest radius in the part, `r`, so that R7's rule on flat pieces holds. A circle drawn with `n` flat pieces has pieces `2 * r * sin(180 / n)` long, so use the smallest multiple of 4 that is at least `180 / asin(0.25 / r)`, with angles in degrees: 52 for a radius of 4, 104 for 8, 128 for 10 and 252 for 20. A fixed 96 holds only up to a radius of 7.6. ## How to measure it | | `cadquery` | `openscad` | | --- | --- | --- | | Volume and bounding box | From the solid itself | From the exported STL, with a mesh library | | Watertight | From the exported STL, with a mesh library | The same | | Overlap of lid and base | Volume of their intersection is under 0.01 | Intersect, export, and check the result is empty | To place the lid for the overlap check, turn it over and set its plate on top of the walls: the lip then runs from `Z = H + t - 3` to `Z = H + t`. For the overhang check, take each face's normal from the STL. A face fails if its normal points downward at more than 45 degrees from horizontal and it is not on the print bed at `Z = 0`. ## What this spec leaves to you Where this spec names something, use that name, so that two builds of it agree. Where it does not, the choice is yours. List what you chose in the README.