Most OpenSCAD code builds the same shape here. The differences come from one choice: ReDo.Core builds exact solids, where OpenSCAD builds meshes of triangles.
Circles are exact
$fnstarts at 0, which means a true circle.circle(),cylinder()androtate_extrude()make real curves, so there is no need to raise$fnto smooth a hole. Set$fnonly when you want a polygon:$fn = 6makes a hexagon.$fnabove 512 is refused. No part needs that many sides, since the circle is already exact.$faand$fsdo nothing.sphere()is always exact, whatever$fnsays.
What builds differently
cylinder(h, r1)with nor2is a straight cylinder. OpenSCAD tapers it tor2 = 1.+joins strings:"hole_" + 3is"hole_3". OpenSCAD givesundef.- A 2D shape keeps its height. OpenSCAD flattens a 2D shape onto the floor; here
translate([0, 0, 2]) square(5)stays 2 mm up. The extrudes andhull()refuse a 2D shape that is not at z = 0. - A 2D shape left in a part is part of it: a flat sheet with no thickness, such as a label or a pad on a board. OpenSCAD drops 2D shapes that sit beside 3D ones.
- A module's children are built before the module runs. A
$setting the module sets inside itself does not reach the children it was handed. One set on the call,m($fn = 6) { ... }, does. - A module is built once for the same arguments, so an
echo()inside it prints once for each different call. hull()samples curved faces. A hull of boxes is exact; a hull of round shapes is a solid of many small flat faces that stays within 0.1 % of the true one.offset()works on 2D shapes only, and keeps arcs as arcs.text()has one font, ReDo Sans (Liberation Sans, the font OpenSCAD draws by default), and lays text out as OpenSCAD does.render()does nothing: every shape is already exact.
What it refuses that OpenSCAD lets pass
Each of these stops the build with a message saying where, rather than building something you did not mean:
- a name nothing defines (OpenSCAD warns and reads
undef); - a name read before it is assigned, as in
a = b; b = 2;; - a named argument the call does not take;
- a 2D size given to
cube(); - a
polygon()whose outline crosses itself; - a
linear_extrude()with atwist, or ascaleother than 1; - a 2D shape in a
difference()cutting a 3D one; - a
text()in another font, written right to left, in a script other than Latin, or with a character the font lacks; use <file>: useincludeinstead;- the commands listed under Refused on OpenSCAD support.
Limits on one part
So that a mistake cannot freeze your browser, one part may take:
| Limit | Most |
|---|---|
| Steps: each loop pass, call and value of a range | 10,000,000 |
| Shapes built | 250,000 |
| Values in one range | 1,000,000 |
Sides of a circle ($fn) | 512 |
| Files included inside one another | 8 |
Errors
An error names its line and column, and the library file when it is in one: line 2, column 8: expected ")", found ";".