Hacker News new | past | comments | ask | show | jobs | submit login

you know the language is limited/poorly thought out when dozens of people re putting time into making tools that do nothing but wrap it in order to make it usable.



OpenSCAD is a terrible programming language. It's a bull moose on bad acid of a specification language, tho. So much so that its easy to mistake it for the programming language it isn't, and hurt yourself trying to milk it in the same way.

Much like sendmail.cf files.


> Much like sendmail.cf files.

That's an exaggeration, being as bad as sendmail.cf is really hard. You have to get to Brainfuck[1] level to beat sendmail.cf

However, I agree, the OpenSCAD language is pretty darn bad.

So bad in fact that someone had to write an OpenSCAD parser in OpenSCAD just to be able to do what he wanted:

https://github.com/davidson16807/relativity.scad/blob/master...

[1] https://en.wikipedia.org/wiki/Brainfuck


https://github.com/CadQuery/cadquery :

> CadQuery is often compared to OpenSCAD. Like OpenSCAD, CadQuery is an open-source, script based, parametric model generator. However, CadQuery stands out in many ways and has several key advantages:

> The scripts use a standard programming language, Python, and thus can benefit from the associated infrastructure. This includes many standard libraries and IDEs.

> CadQuery's CAD kernel Open CASCADE Technology (OCCT) is much more powerful than the CGAL used by OpenSCAD. Features supported natively by OCCT include NURBS, splines, surface sewing, STL repair, STEP import/export, and other complex operations, in addition to the standard CSG operations supported by CGAL

> Ability to import/export STEP and the ability to begin with a STEP model, created in a CAD package, and then add parametric features. This is possible in OpenSCAD using STL, but STL is a lossy format.

> CadQuery scripts require less code to create most objects, because it is possible to locate features based on the position of other features, workplanes, vertices, etc.

> CadQuery scripts can build STL, STEP, and AMF faster than OpenSCAD.

What are some of the advantages of OpenSCAD tooling?


OpenScad is fine but it's scad and not a general programming language.


From the limited work I've done in it, it comes off as poor for it's specific use as well.

As an example, one thing that frustrates me is not having access to the geometry of an object. I fairly frequently want to do something like "add this piece so that it's 20% down from the upper edge of this other piece". I've yet to find any way to do that cleanly, despite it seeming like a common use case. The absolute addressing system can be painful, since updating a piece can require updating locations in lots of place. Likewise, but worse, it's extremely painful to rotate and object, because your algorithms for finding the location break.

I've largely given up and use Fusion. I like being able to version control my models, but SCAD feels like I'm working blind with a hand tied behind my back, rather than making things feel expressive like they usually do.


Make sure you are using BOSL - http://openscad.org/libraries.html

Also all of your base points should be variables and your placements operations on those variables. Anything that is dynamically sized should also be built from variables. I usually use a single function per distinct piece of geometry, then use composition.

The geometry is the effect, not the cause.


It's just higher levels built on lower levels.

openscad could definitely use at least a few things the article mentioned even if it remains a low level layer, and I don't generally like transpilers, but there is nothing automatically wrong with a language that provides mostly primitives and other languages build higher level things out of those.


I don't think the problem is the language but rather the fact that it should have been a pure library to begin with. The fact that libraries are used by many languages isn't surprising. What's surprising is that using the library requires compiling to another language.


I think what they are doing is making the utility of openscad available without having to learn yet another language.

So it doesn't really matter how good the language is.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: