These commands are ReDo.Core's own. Code that uses them will not run in OpenSCAD. The table at the end of this page is drawn from the compiler's own list.

Chamfers

A chamfer cuts a small slope along an edge, as a printed or machined part has. Put the chamfer round the solid before drilling it, so the holes keep sharp edges:

difference() {
    chamfer(0.5) cube([30, 20, 10]);
    translate([15, 10, 0]) cylinder(h = 10, d = 3);
}

chamfer_z, chamfer_r and chamfer_upright break only some edges: the ones in one plane, the circles of one radius, or the upright ones. Each refuses a plane or radius no edge sits on, so a typo does not pass silently.

Many holes at once

difference() cuts its holes one at a time, and each costs more than the last. Gather the holes in disjoint() and they are cut in one pass: a hundred holes take a fraction of the time.

difference() {
    cube([100, 100, 5]);
    disjoint() for (x = [5 : 10 : 95], y = [5 : 10 : 95]) translate([x, y, -1]) cylinder(h = 7, d = 3);
}

It only works when its children do not overlap, and it refuses ones that do. Keep overlapping cutters in the difference() itself.

Short moves

up(5) is translate([0, 0, 5]), zrot(90) is rotate([0, 0, 90]), and xflip() mirrors across X. They read better in a long part.

Paint and finish

  • color("red") paints a piece in a colour that never changes, such as a metal pin.
  • stock("body", "#ffffff") paints the piece a person may repaint in the Material panel. A part has one.
  • material("brass") gives a piece a finish from ReDo's materials library, or a finish of its own: material(color = "teal", metalness = 0.8).

Joins

feature(), port() and face() build nothing. They tell the Playground where a part's holes, pins, sockets and flat faces are, so it can join them to other parts. Holes, pins and sockets explains them.

Drawn lines

thread_edge() draws a thread as lines over a screw or a bore, rather than cutting it, which would cost far more to draw. drawn_line() draws any other line on a part, such as a logo on a stud. Lines add nothing to the solid.

union() {
    cylinder(h = 12, d = 3);
    thread_edge(3, 12, 0.5);
}

Every addition

Combining

CallArgumentsWhat it does
disjoint()noneGathers children that may touch but not overlap, without fusing them: as the cutter in a difference(), a field of holes cut in one pass. Refuses children that overlap.
exclusive_or()noneKeeps what lies in some of its children but not in all of them.

Chamfers

CallArgumentsWhat it does
chamfer()dBreaks every edge of its children by d mm.
chamfer_z()d, zBreaks only the edges lying in the plane at height z.
chamfer_r()d, r, zBreaks only the circles of radius r about Z, those at height z if given.
chamfer_upright()dBreaks only the edges running straight up Z: an octagon from above, a rectangle from the side.

Short moves

CallArgumentsWhat it does
move()vtranslate(v) by a shorter name.
left()xMoves by x towards -X.
right()xMoves by x towards +X.
fwd()yMoves by y towards -Y.
back()yMoves by y towards +Y.
down()zMoves by z towards -Z.
up()zMoves by z towards +Z.
xrot()aTurns by a degrees about X.
yrot()aTurns by a degrees about Y.
zrot()aTurns by a degrees about Z.
xflip()noneMirrors across the plane X = 0.
yflip()noneMirrors across the plane Y = 0.
zflip()noneMirrors across the plane Z = 0.

Paint and finish

CallArgumentsWhat it does
stock()name, cPaints its children colour c and names them name: the one region a person may repaint. One per part.
material()name, color, roughness, metalness, texture, scale, reliefGives its children a finish: a library material by name, or its own colour, roughness, metalness and texture.

Holes, pins, sockets and faces

CallArgumentsWhat it does
feature()name, sex, d, from, to, threaded, role, blind, tag, label, key, flat, flats, gear_teeth, gear_module, gear_face, seat, slot, gear_tooth, terminal, gear_apex, thread_pitch, thread_starts, gear_cone, self_tapping, centred, bead, splined, spline_teeth, gear_backDeclares a hole or a pin the Playground can join, from from to to, d across. No geometry.
port()name, connector, from, to, across, size, ways, pitch, lead, label, pinsDeclares a socket a connector cable plugs into. No geometry.
face()name, at, normal, across, size, labelDeclares a flat face another part's face can sit flush against. No geometry.

Drawn lines

CallArgumentsWhat it does
thread_edge()d, length, pitch, side, segmentsDraws a thread as a helix of lines over a shank or a bore, side "male" or "female". No geometry.
drawn_line()pointsDraws a line through points over the part. No geometry.