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.
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.
oh wow, ditching CGAL that’s a huge change under the hood. BRB installing nightly …
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.
FDM not EDM
I dunno, with some complex shapes my Printrbot *sounds* like an EDM machine. ;)
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?
Try it “GatorCAM for CNC”.
It’s awesome
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.
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?
Does OpenSCAD work if I have to design a part around an existing part’s 3D model (STEP file or whatever 3D format).
You can import STL.
It’s a great step but manifold still has some bugs… it’s unusable for me until they fix short line segment rendering – e.g. curves.
https://github.com/openscad/openscad/issues/4679
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Importing_Geometry#import
Main file types imported are DXF and STL. I have used an imported STL file (the positive) to subtract from a solid shape to make a mould (the negative). You can slice, dice and add to a shape that is imported.
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 :)
3mf seems to be the go-to next format.
Isn’t 3mf just STL plus some configuration data in a compressed archive?
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).
Does anyone know why the most recent stable release is more than two years old? What are the preconditions too promote a build to stable?
https://github.com/openscad/openscad/issues/3781
this issue is blocking release because it is a regression
Thanks for sharing that link. I looked at it, but I must admit I didn’t understand the details. Can you explain why the one issue would block releases for two years?
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.
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*
But when can it produce multi material models directly for prusa mmu and bamboo and the like?
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.
AnchorSCAD has multi material support. It generates a openscad source that contains multiple models and if you turn on ‘lazy union” and export as 3mf you’ll get a file with a model for each material. See https://github.com/owebeeone/anchorscad/blob/master/docs/multi_material.md
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.
indeed you can use this now in nightly version, just enable the experimental option
Wow… Just wow! Parts that took half an hour to render now take seconds!
Took some of that freed up time to donate whole I was at it. This sort of development deserves extra support.
thanks for reminding me to donate. I’ve been making money off my models, time to give it back
i hope someday a open source alternative to tinkercad… modeling there is sooo easy…