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.

NameValueWhat it is
GRID10The grid every ReDo part sits on, in mm.
SCREW_HOLE_D2.75A hole a screw threads into.
THRU_HOLE_D3A hole a screw passes through.
M3_D3An M3 screw's diameter.
M3_PITCH0.5An M3 thread's pitch.
PLATE_T_THIN2.5A thin plate's thickness.
PLATE_T_MID5A plate's thickness.
PLATE_T_THICK10A thick plate's thickness.
CORNER_R5The radius of a rounded corner.
CHAMFER0.5The one size every edge is broken by.
DIA_UNDERCUT0.2How much under its size a round part is drawn, so it fits a hole of that size.
CSK_D6A countersink's top diameter.
CUT_MARGIN1How far a cutter runs past the faces it cuts.
CUT_REACH200How long a hole cut with no length is.
THREAD_ANGLE13How steeply a drawn thread climbs, in degrees.
THREAD_STARTS4How many helices a drawn thread has.
THREAD_MOUTH2.5How 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

CallArgumentsWhat it does
hole()d, thruA cutter for a hole d across, standing on Z, long enough to go right through.
hole_x()d, thruhole() lying along X.
hole_y()d, thruhole() lying along Y.
countersink()top_d, hole_dThe cone a countersunk screw's head sits in.
csk_depth()top_d, hole_dHow deep that cone is.
outer_d()nominalA round part's diameter for a nominal size: outer_d(10) is 9.8.
stock_t()thicknessA plate's thickness by its name, "2.5", "5" or "10".
drawn_pitch()dThe pitch a drawn thread climbs at on a diameter.
thread_bore()d, lengthDraws a female thread at each end of a bore.
thread_bore_x()d, lengththread_bore() lying along X.
thread_bore_y()d, lengththread_bore() lying along Y.
thread_lines()d, length, sideDraws a thread's helices along Z.
hole_at()iThe centre of grid cell i: hole_at(0) is 5.
span()nThe 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, stepRepeats its children count times, step apart.
grid_array()columns, rows, pitchRepeats 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.