Every ReDo part starts from the same library, and yours can too:
include <redo_constants.scad>
difference() {
chamfer(CHAMFER) cube([span(3), span(1), 10]);
for (i = [0 : 2]) translate([hole_at(i), hole_at(0), 0]) hole(THRU_HOLE_D);
}
include reads the file where it stands, as in OpenSCAD. It reads only ReDo's own library files: a part cannot read a file from your computer or the web. Including the same file twice adds nothing the second time.
Constants
The values every ReDo part shares. A name in capitals is fixed; see Rules for a part.
| Name | Value | What it is |
|---|---|---|
GRID | 10 | The grid every ReDo part sits on, in mm. |
SCREW_HOLE_D | 2.75 | A hole a screw threads into. |
THRU_HOLE_D | 3 | A hole a screw passes through. |
M3_D | 3 | An M3 screw's diameter. |
M3_PITCH | 0.5 | An M3 thread's pitch. |
PLATE_T_THIN | 2.5 | A thin plate's thickness. |
PLATE_T_MID | 5 | A plate's thickness. |
PLATE_T_THICK | 10 | A thick plate's thickness. |
CORNER_R | 5 | The radius of a rounded corner. |
CHAMFER | 0.5 | The one size every edge is broken by. |
DIA_UNDERCUT | 0.2 | How much under its size a round part is drawn, so it fits a hole of that size. |
CSK_D | 6 | A countersink's top diameter. |
CUT_MARGIN | 1 | How far a cutter runs past the faces it cuts. |
CUT_REACH | 200 | How long a hole cut with no length is. |
THREAD_ANGLE | 13 | How steeply a drawn thread climbs, in degrees. |
THREAD_STARTS | 4 | How many helices a drawn thread has. |
THREAD_MOUTH | 2.5 | How deep a bore's drawn thread runs in from each end. |
Two hole sizes, not interchangeable. SCREW_HOLE_D is a hole a screw threads into, as in a block something is fastened to. THRU_HOLE_D is a hole a screw passes through, as in a plate or a bracket. They look the same on screen; the wrong one would strip or not hold.
Helpers
| Call | Arguments | What it does |
|---|---|---|
hole() | d, thru | A cutter for a hole d across, standing on Z, long enough to go right through. |
hole_x() | d, thru | hole() lying along X. |
hole_y() | d, thru | hole() lying along Y. |
countersink() | top_d, hole_d | The cone a countersunk screw's head sits in. |
csk_depth() | top_d, hole_d | How deep that cone is. |
outer_d() | nominal | A round part's diameter for a nominal size: outer_d(10) is 9.8. |
stock_t() | thickness | A plate's thickness by its name, "2.5", "5" or "10". |
drawn_pitch() | d | The pitch a drawn thread climbs at on a diameter. |
thread_bore() | d, length | Draws a female thread at each end of a bore. |
thread_bore_x() | d, length | thread_bore() lying along X. |
thread_bore_y() | d, length | thread_bore() lying along Y. |
thread_lines() | d, length, side | Draws a thread's helices along Z. |
hole_at() | i | The centre of grid cell i: hole_at(0) is 5. |
span() | n | The length of n grid cells. |
female() | name, d, from, to, … | feature() for a hole, its sex already said. |
male() | name, d, from, to, … | feature() for a pin or shaft, its sex already said. |
linear_array() | count, step | Repeats its children count times, step apart. |
grid_array() | columns, rows, pitch | Repeats its children in columns and rows, pitch apart. |
female() and male() take the same settings as feature(); Holes, pins and sockets explains them.
The other library files
Each of these includes redo_constants.scad and adds the modules one family of ReDo parts is built from:
redo_construction.scad: blocks, plates, brackets, profiles, rods, gears, pulleys, bearings, guide rails, motor cases, sheets and timber.redo_hardware.scad: metric screws, nuts, washers, spacers and V-slot T-nuts.redo_electronics.scad: headers, boards, components, connectors, batteries and printed lettering.redo_lego.scad: LEGO bricks, plates, slopes, Technic parts, wheels and minifigures.
The easiest way to see how they are used is to open a part from the Inventory and read its code.