OpenJSCAD - OpenSCAD in the browser

image credits

OpenSCAD is a free software application for creating solid 3D CAD (computer-aided design) objects. It is a script-only based modeller that uses its own description language … — Wikipedia: OpenSCAD

I just downloaded OpenSCAD in the morning before I saw the OpenJSCAD link at Lobsters. Yes, it is nearly the same … except that it runs in the browser. You can write OpenSCAD code and create an STL file that can be used for 3D printing.

When you open OpenJSCAD, there is already an example. I’ve scaled up the inner sphere / cube and moved it to the bottom:

function main () {
  return union(
      cube({size: 3, center: true}),
      sphere({r: 2, center: true})
      sphere({r: 1.7, center: true}),
      cube({size: 2.8, center: true})
    ).translate([0, 0, -0.1]) // move it to ground
  ).translate([0, 0, 1.5]).scale(10);

To render the code press Shift+Enter and with Generate STL you can download the STL code. The STL file can be used in a slicer program, for example Ultimaker Cura.

OpenJSCAD Screenshot

… and here is the result. I scaled it down by 50%, which was too small and therefore not stable 🤷‍♂️:

OpenJSCAD 3D Printed