At Last! Faster OpenSCAD Rendering Is On The Horizon

Known as “The Programmers Solid 3D CAD Modeller”, OpenSCAD is used by many people for whom writing code comes more naturally than learning a fiddly user interface. It’s a very capable piece of software, but regular users will tell you that it can be rather slow when it comes to rendering your work. We’re very pleased to see that a fix for this has been produced courtesy of [@ochafik], can now be found as an experimental feature in nightly builds, and will in due course no doubt find its way to official releases.

Despite a modern computer invariably having a multi-core architecture, it might surprise you to find that OpenSCAD wasn’t able to take advantage of this previously. The above-linked thread spans over a decade of experimenting and contains some fascinating discussions if you’re prepared to wade through it, and culminates a few weeks ago in the announcement of the new feature giving access to multiple CPUs. We don’t have it yet, but it’s great to know it’s in the works and we’re looking forward to render time involving considerably less of a wait.

So many OpenSCAD projects have passed through these pages over the years, it’s safe to say that it has a significant user base among Hackaday readers. It’s still something an AI hasn’t mastered yet though.

Thanks [pca006132] for the tip.

29 thoughts on “At Last! Faster OpenSCAD Rendering Is On The Horizon

  1. In short, this is replacement of the notoriously slow CGAL library with Manifold one.
    Use nightly/dev build.
    Enable it in edit/preferences/features (“Use the Manifold library for CSG operations instead of CGAL”).

    On one model, the rendering time was cut from half hour to under three seconds.

  2. I am a big fan of OpenSCAD and use it daily. Versions are available for Windows, Mac and Linux (my preferred OS, plain vanilla Debian). I use it to make 2D svg files for my local makerspace Epilog laser cutter (the exported svg XML file has to be tweaked to open correctly on Adobe Illustrator). Cura (also available for Linux) opens the exported stl files and makes a Gcode file which runs on any number of EDM 3D printers. The OpenScad file has to be very complex to bother me with prolonged render times. Tried to learn FreeCAD but found I could not easily construct the simple geometric models I need.

      1. John,

        I’m finishing up a CAM program that reads svg. I use OpenSCAD to generate the svg at different heights.

        (So inside my CAM program you just click shapes for profiles/pockets etc for CNC).

        Is “projection” how you make your SVGs in OpenSCAD?

    1. Everything cubic is rendered ok. But if it is somewhat rounded or extruded it slows rendering down noticeable.

      I’m with you at FreeCAD. After I learned how to use a hammer, all problems are solved with nails. Can’t switch my tool now anymore.

    2. I’m finishing up a CAM program that reads svg. I use OpenSCAD to generate the svg at different heights.

      (So inside my CAM program you just click shapes for profiles/pockets etc for CNC).

      Is “projection” how you make your SVGs in OpenSCAD?

      1. I sure hope STL dies very soon and all those other slicers besides PrusaSlicer allow for STEP-import. STL is such an ugly format and makes everything but plain “printing it” a real PITA. I don’t care if PrusaSlicer internally makes an STL from it, give me STEP import everywhere please :)

    1. STL import is a choice.

      When making your own part to duplicate another one that was given just as a STL shape without parameters, show it as transparent gray and fiddle with your parametric design until the components overlap enough. A night with a caliper on printed model failed, a short while with an imported STL did the job. I still feel dumb I didn’t start that way. (The part was the NASA fabric tile where I wanted it parametric. Todo, publish.)

      STLs can then be cut to part, hollowed out, moved, scaled, overlapped… all with openscad syntax.

      Sometimes STL models don’t taste good enough to openscad. Then they can be repaired with Meshlab, or with Blender (boolean AND operation over the model and a cube that overlaps it).

  3. AnchorScad uses OpenSCAD as the rendering engine. Pre manifold it takes 20 times longer on average to create an STL file. Running all the models in AnchorScad went down from most of an hour to a few minutes. It did have a few issues. It didn’t like extrusions that had overlaps in 2d polygons. Fixed it by postprocessing AnchorScad Paths to remove overlapping path segments. This is going to make OpenSCAD a whole bunch better.

  4. Finally! Exciting times! My love-hate relationship with OpenSCAD is turning into warm fuzzy löööve…

    Tried a model of a screw using a threads library. Went from 13 s to 0.2 s rendering time!

    Another model went from 115.7s to 2.7s!

    *giggle giggle*

    1. Kinda? If you make one module per “color”, let’s pretend you have 8 modules/parts which should be 2 colors/materials. Additionally, we need to suppose that all 8 modules preview/render so the preview looks right. Comment out the modules which should be one color and render the modules at the same time, then reverse the commenting and render the balance.
      There’s likely a scripting option to further automate this process, but at this stage you should have 1 STL per intended filament. In the add part dialogue of Prusaslicer select both files, and click yes. You will be asked if the items should be considered separate parts, the answer is no. Prusaslicer will then allow you to set an extruder. This may need you to have a multi filament printer set up/chosen.

  5. Having rendered many slow parts in OpenSCAD, please make this our future. We need threads for physical threads. I have wanted this feature for a long time, along with thread-like features with native support. I have waited long times on some parts with excess detail, and some parts even had halting problems. Please let me use my 8 cores to the fullest.

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.