Projects

OneWall — running the same geometry twice, in OpenSCAD and in the browser

The position: duplicating an implementation is usually a mistake. This is the case where I did it on purpose, and I can tell you exactly what it bought.

OneWall is a parametric model for containers printed in vase mode — a single continuous wall, one nozzle wide. The shape is controlled by about thirty parameters: three height sections, a vertical profile curve, fourteen wall textures, five lip cross-sections, an optional label slot. The parameters interact. Change the profile and the lip that looked right no longer does.

The honest workflow for that model is a loop: change a number, render, look, change it back. In OpenSCAD, F6 on a model at this resolution is slow enough that you stop exploring and start committing to your first guess. That is the actual failure — not the seconds, but the design decisions you never make because trying them is expensive.

What was tried, and what it cost

The fix was to make the loop fast, and the only place fast enough is the browser. So the same geometry maths exists twice: once in onewall.scad, and once in JavaScript driving Three.js. Every parameter change recomputes the mesh in roughly 10–50 ms, which is under the threshold where a slider stops feeling like a command and starts feeling like a handle.

The cost is exactly what you would predict: two implementations that must agree. There is no clever escape from this. Every profile mode, every texture, every lip style exists in two languages, and a change to one is a bug in the other until it is a change in both. I accepted that on one condition — that the ambiguity about which one is right is never allowed to exist. The .scad file is the source of truth for anything that gets printed. The browser is a fast way to find the parameters, not a way to produce the final part. That rule is written in the README, on the tool page, and in the export warnings, because a duplicated implementation without a declared authority is how you get two subtly different objects and a long afternoon.

Export honesty was the second cost. STL out of the preview is a mesh, and that is fine — a printer wants a mesh. STEP is where it gets uncomfortable. The preview's geometry is a triangle mesh, so the STEP export writes every triangle as its own planar face. It is a valid AP214 solid and it imports into Fusion, SolidWorks or FreeCAD as a body — but it is a body, not a feature tree, and the files are large: roughly 10 MB for a small bin, 30 MB for a large one. I could have shipped that with the word "STEP" and let people discover the rest. Instead the limitation is stated on the button's own page. A CAD user who imports a 30 MB faceted solid expecting an editable model has been misled, and they will be right to say so.

The signature is a printing constraint, not a decoration. Every bin carries @Amitkuzi engraved 0.2 mm into the floor. In OpenSCAD it is a true difference() against the body, so the result is still one solid and still vase-mode compatible — a signature that broke spiral mode would be a signature nobody keeps. It also needs at least two bottom shell layers, or the engraving punches through and reads from inside the bin. That is documented next to the setting rather than buried, because it is the kind of detail that turns into a support thread.

The rule, and its boundary

Duplicate an implementation only when the two copies serve genuinely different masters, and name which one wins before you start. Here one serves correctness and the other serves latency, and they are not in competition because the authority question was settled in advance.

Vase mode also forces a nice constraint: with one nozzle-wide wall you cannot add material, so stiffness has to come from shape. Crossed textures — grid, fabric, diamond, knurl, and the kumiko lattice patterns — behave like crossed ribs. A barrel profile adds hoop strength. That is a structural problem solved in geometry because the process left no other lever, which is a fair description of most interesting engineering.

Where this breaks

Details

Source of truth
onewall.scad — OpenSCAD 2021.01+, Customizer-ready for MakerWorld, Printables and Thangs
Browser preview
Three.js, OrbitControls, lil-gui, three-bvh-csg; parameter, material and lighting panels; session save/load as JSON
Export
Binary STL; faceted ISO-10303-21 AP214 STEP via a purpose-written exporter
Licence
Apache-2.0 for the code; CC BY 4.0 for the models you generate from it — CC BY is deliberate, its attribution requirement means every remix carries the credit back

Launch OneWall → · Docs and FAQ → · Source →