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.
THREAD_GAP0.05How far a real thread screw sits in from the basic ISO profile, so it turns freely in a real thread nut.

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.
iso_minor_d()d, pitchAn ISO metric thread's minor diameter for a diameter and pitch.
iso_base_r()d, pitch, length, gapHow far in from the axis an ISO thread's tooth is swept from, refusing a pitch too coarse for the diameter.
iso_teeth()d, pitch, length, gap, tip, tip_endA whole ISO metric thread, core and teeth, length long up Z, built in one go by thread_solid().
iso_thread()d, pitch, length, gap, tipA real ISO metric thread along Z, length long; gap shrinks it for play, tip chamfers its foot.
iso_tap_teeth()d, pitch, lengthThe whole cutter of a real tapped bore, run a CUT_MARGIN past its mouth: subtract it once, wherever the hole runs.
iso_tap()d, pitch, lengthCuts a real ISO metric tapped bore length deep into its children, up Z from z = 0.
tr_teeth()d, pitch, starts, length, gap, tipA whole ISO 2904 trapezoidal thread, core and every start's teeth, length long up Z, built in one go by thread_solid().
tr_thread()d, pitch, starts, length, gap, tipA real ISO 2904 trapezoidal thread along Z, starts side by side; gap shrinks it for play, tip chamfers both ends.
tr_tap()d, pitch, starts, lengthCuts a real trapezoidal tapped bore length deep into its children, up Z from z = 0.
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, and the Dummy 13 action figure's ball and socket.
  • 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.