Rendering OpenSCAD In The Browser

If you haven’t heard of it, OpenSCAD is a really wonderful tool for 3D modeling.  While it doesn’t have the traditional graphical interface of AutoCAD – it’s basically a programming language for 3D models – OpenSCAD is able to create very complex parts with only a few lines of code.

That’s all well and good, but what if you wanted to edit OpenSCAD parts in your browser? Enter OpenJsCAD, an OpenSCAD interpreter written entirely in Javascript and able to be embedded in a web page.

OpenSCAD allows for two types of modeling – constructive solid geometry, or taking 3D primitives and stretching, scaling, and intersecting them to create a 3D shape, or extrusion from a 2D outline. Quite a few RepRap parts were designed in OpenSCAD, and the lightweight interface and open source nature means it’s perfect for designing stuff to print on your Makerbot.

Tip ‘o the hat to [Gordon] for sending this one in, and we really have to commend him for writing his own online scriptable CAD exporter before finding out about OpenJsCAD. He may be a little late to the online OpenSCAD party, but we have to agree with him that an online 3D solid editor would be an awesome feature for Thingiverse to roll out.

13 thoughts on “Rendering OpenSCAD In The Browser

      1. I found OpenJsCAD was surprisingly fast compared to OpenSCAD. It is definitely very usable, although it lacks OpenSCAD’s instant preview.

        The speed depends on how you design your shape. Plenty of things will calculate in the blink of an eye, but if you use loads of spheres or very high polygon counts, it starts to take longer.

        With OpenJsCAD, you can always write the JavaScript to create the Mesh a triangle at a time. With that, the fisher price record creator would be blindingly fast.

  1. This gets a lot of respect from me. I haven’t messed with CSG CAD programs since BRL-CAD/mged over a decade ago. Sure don’t miss going from solids to vectors. That part of the process was always over my head even when that’s exactly what the code I was debugging did.

  2. Must get a look at OpenSCAD I’ve a bit of a fetish for CAD model formats.

    AutoCAD isn’t much to aim for. CATIA is much more my flavour when it comes to CADing. Very reliable interface.

    1. When you say “CAD model formats”, are you referring to the UI, or format of the saved data? I’ve used Unigraphics 5, and thought that it was the perfect app for a 3DOF input device (spaceball), but when I looked at converting data from CATIA I found that they use a big Opensource bag to hold a couple proprietary encrypted BLOBs. If you want to get data away from them, it’s not gonna be cheap.

      1. Format of the saved data. Although in my preference for CATIA I was talking about its UI. STEP and IGES work across most CAD packages. Though there is the downside that the models become “dumb”. My first real CAD job involved drawing and assembling a crane for an Exechon PKM, the reason being it was cheaper to have me spend 6 weeks re-drawing a Solidworks model than the company buying the .catpart license for S/W!

        I did see a really interesting presentation at a conference a few years ago about a group of Brazilian engineers who were trying to build a “smart” format which would map CAD features from all CAD major formats to a generic format, but still retain the feature based nature. Allowing the import of not only the Geometry but also the design tree and therefore the design methodology.

        Seemed like a good idea, but I haven’t seen it since.

    2. Just had a read. CSG modelling, very 1996. I don’t think that OpenSCAD is for me, although I have come across openCASCADE, B-rep, and there’s a couple of CAD packages based on it. Might stick them on my modelling PC at work and see what kind of results I get.

      I do like CATIA, but it’s not without it’s faults (like defining everything as bloody positive distance from the origin, or every license costing £1000s). A native API for python and MATLAB (the MATLAB thing is a personal desire, but there’s plenty of engineers who use it). The ability to define custom primitives and programatically define contraints would be nice.

  3. You call this an “OpenSCAD interpreter written entirely in Javascript and able to be embedded in a web page”, but from what I see, it cannot interpret OpenSCAD at all.

    From the site:”This is intended to become a Javascript based alternative to OpenSCAD, for 3D solid modeling.”

  4. Having been a loyal hackaday reader for years I must’ve come across this before.

    I was looking for a web based openscad interpreter (to show someone without openscad what I’ve made today).

    The name of the project should be read as: open-js-cad. Javascript CAD. It bears some resemblance to openscad in the way that models are made but in no way does it interpret openscad language.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.