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
| Call | Arguments | What it does |
|---|---|---|
disjoint() | none | Gathers 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() | none | Keeps what lies in some of its children but not in all of them. |
Chamfers
| Call | Arguments | What it does |
|---|---|---|
chamfer() | d | Breaks every edge of its children by d mm. |
chamfer_z() | d, z | Breaks only the edges lying in the plane at height z. |
chamfer_r() | d, r, z | Breaks only the circles of radius r about Z, those at height z if given. |
chamfer_upright() | d | Breaks only the edges running straight up Z: an octagon from above, a rectangle from the side. |
Short moves
| Call | Arguments | What it does |
|---|---|---|
move() | v | translate(v) by a shorter name. |
left() | x | Moves by x towards -X. |
right() | x | Moves by x towards +X. |
fwd() | y | Moves by y towards -Y. |
back() | y | Moves by y towards +Y. |
down() | z | Moves by z towards -Z. |
up() | z | Moves by z towards +Z. |
xrot() | a | Turns by a degrees about X. |
yrot() | a | Turns by a degrees about Y. |
zrot() | a | Turns by a degrees about Z. |
xflip() | none | Mirrors across the plane X = 0. |
yflip() | none | Mirrors across the plane Y = 0. |
zflip() | none | Mirrors across the plane Z = 0. |
Paint and finish
| Call | Arguments | What it does |
|---|---|---|
stock() | name, c | Paints 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, relief | Gives its children a finish: a library material by name, or its own colour, roughness, metalness and texture. |
Holes, pins, sockets and faces
| Call | Arguments | What 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_back | Declares 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, pins | Declares a socket a connector cable plugs into. No geometry. |
face() | name, at, normal, across, size, label | Declares a flat face another part's face can sit flush against. No geometry. |
Drawn lines
| Call | Arguments | What it does |
|---|---|---|
thread_edge() | d, length, pitch, side, segments | Draws a thread as a helix of lines over a shank or a bore, side "male" or "female". No geometry. |
drawn_line() | points | Draws a line through points over the part. No geometry. |