
AngelCAD: Script-based 3D solid modeller - app4soft
https://arnholm.github.io/angelcad-docs/
======
cacb
I am the designer/developer of AngelCAD. It began from a desire of a fast
Constructive Solid Geometry engine, based on a strongly typed scripting
language. It is not a goal of the core AngelCAD package to develop a
traditional CAD GUI, the emphasis is on scripting.

The boolean engine used is xcsg
[https://github.com/arnholm/xcsg](https://github.com/arnholm/xcsg) based on
Carve [https://github.com/arnholm/carve](https://github.com/arnholm/carve)

~~~
contingencies
Why is the syntax so heavy and C-esque?

Documentation sections such as _Datatypes in AngelScript_ , _C++ Object
handles to the application_ and _Memory management_ are not features I want in
a declarative language: accepted wisdom is to use the least powerful tool for
the job. Edge cases should be dealt with as the exception, not burdensome as a
rule which can be convention over configuration.

I would like to suggest something lighter.
[https://gist.github.com/globalcitizen/ded2ba77b48f75f2813f15...](https://gist.github.com/globalcitizen/ded2ba77b48f75f2813f156c84246e24)

This would be simpler, less keystrokes, shorter and more legible.

~~~
cacb
It is specifically not a 'declarative' language, it is a general purpose
language. OpenSCAD uses a declarative language, AngelCAD does not. If you want
a declarative language, use OpenSCAD or implement your favorite language on
top of the AngelCAD boolean engine (xcsg).

~~~
contingencies
_It is specifically not a 'declarative' language, it is a general purpose
language._

OK, but why?

Edit: Why not is because of the mentioned norm, ie. use the least powerful
tool for the job. Alternatively stated, KISS. Asking programmers to delve in
to a new set of assumptions, limitations and so on that could otherwise be
avoided is creating friction. Unless there is an explicit reason for doing so,
it does not seem wise.

Further edit: You make a good point about thought process, and I think
_graphviz_ is a clear example of a popular tool where the friction you mention
between application-specific concerns and restrictive declarative syntax often
lies, sometimes complicating an overall workflow.

~~~
cacb
Why should it be a 'declarative' language? There is no inherent benefit in
that IMHO. I want the full set of capabilities that a general purpose language
can offer, and still be scriptable. What is easier or more legible is very
subjective. Your example does not seem easier to me.

Another thing is that I chose to use an existing language instead of creating
a new one. I chose AngelScript because it was very easy to integrate with the
implementation language (C++) and because it existed, was well documented and
had all the features I wanted.

You could argue that one could choose another existing language (Python or
whatever), and that is fair enough. The design is such that the language
interpreter is entirely separate from the boolean engine (they are different
executables), so all you have to do is implement the AngelCAD features in the
scripting language you prefer and give it to the world. That is essentially
what I did.

~~~
contingencies
_Your example does not seem easier to me._

The point, ex comments, is that it removes all the crap about scenes and setup
and output and memory and types. Nobody cares, human time has value, machine
time is free, and it's 2020.

Also, it's more expressive (more meaning in less space), which is a great
feature.

~~~
ajnin
> Nobody cares, human time has value, machine time is free, and it's 2020.

I disagree about types, it's great to actually know what you're dealing with
and instantly know what operations you can do on objects without deep diving
into layers of code and outdated documentation (the "ruby way"). Also I don't
know if you have actual experience with CAD design but machine time is
definitely not free there.

A declarative syntax seems better in theory but in practice if forces clunky
syntax as soon as you are dealing with slightly deep hierarchies. Imperative
syntax is just simpler, you can manipulate objects directly, pass them around
to functions, the "object" paradigm makes sense here.

~~~
contingencies
_I don 't know if you have actual experience with CAD design but machine time
is definitely not free there._

Heh, actually I run a robotics company. There are multiple people working for
me full time doing CAD design. I would argue that delays due to tedious input
in an industrial fabrication context are more expensive as you are not just
using human time but also blocking on supply chain and 'machine time'
scheduling, and ultimately potentially all business expenses. For this reason
I do not understand your point.

------
elcritch
This looks very similar to OpenSCAD. If it's being actively developed I'll
have to take a look at it!

Though, I really wish people would do something like this built on Julia (or
perhaps even Nim). There's nothing too magical IMHO in what I can see of
AngelScript or OpenSCAD script that couldn't be done with macro
transformations. Then you'd get a real language with better documentation,
semantics, etc and could integrate with a larger echo system.

I'd love to have an ecosytem in Julia where you could build 3D models, then
plug them into a FEM model feeding the results into a deep neural net.

~~~
generalizations
I think the GUI would be the hard part there. The paid / professional tools
have a lot of functions that improve the process of constructing models and
viewing them. A clean backend would be nice, but the user experience is what
would need to be solved.

~~~
elcritch
Good point. The professor who taught my course on FEM said most of the
commercial tools had FEM models not much more complex than the ones you'd make
in a graduate FEM course. The real money was the GUI (and market share).

One thing I've been waiting in Julia is a nice GUI toolset, but they all seem
to be broken or incomplete. Julia's static compile ability is also lacking
currently. My take is that there's an opening in the market for a good CAD
program based on an open source modeling engine. Sell the GUI for money (or an
enterprise polished version), but make the core engine and modeling open
source and with a good API. It'd be a small market slice (e.g. grad students,
small startups), but perhaps it could gain mindshare over time.

~~~
imtringued
Isn't the market for CAD software pretty much saturated? Most users learn one
of the few established CAD programs during college or on the job and never
learn anything else.

There is still an opportunity for a good opensource CAD program but only
because the existing ones such as FreeCAD need an overhaul. Forking FreeCAD
and fixing the glaring flaws would be significantly less work. The FreeCAD
project is stagnating. There is an issue about someone wanting a visualization
of the internal coordination system of a datum plane. That visualization
already exists in other parts of FreeCAD but when you go through the forum
posts you see that one of the users is blocking this absolutely microscopic
change because of mathematical purity. Mathematically speaking planes don't
have an orientation and therefore this feature would not make logical sense
and you should use a local coordinate system if you want to change the
orientation, including visualization. Except FreeCAD implements a datum plane
with an internal local coordinate system. This results to weird things like
sketches being rotated by 90°. There is no way to know in which direction your
sketch has been rotated without the requested visualization so even if you
wanted you can't just reattach your sketch in the correct orientation. You
first have to mark the "up" direction by drawing an arrow in the sketch and
then orienting the sketch with the help of that arrow. There is no need to
talk about mathematical purity when the software has already broken it and
makes the user suffer as a result.

~~~
willis936
Solidworks and Autocad have horrible backends. They are slow as sin and single
threaded. Neither company is paying technical staff to improve the product.

I use openSCAD for 3D printing, but its limitations become quickly obvious.
All surfaces are a series of 4 sided polygons. I would prefer to be able to
define smooth curves and only choose the resolution on export. The language
itself is a trip to wrap your head around. I regularly need to keep 4 levels
of transformation in my head when working on an individual piece. There are
better ways. I will need to look at AngelCAD.

------
eggy
I've tried OpenSCAD, and it's nice for what it is. I'll see if this offers
more powerful scripting.

I used to program AutoLISP routines in AutoCAD decades ago. Creating geometry
strictly from LISP without using the GUI was amazing.

One I tried that was striving to make the PL uniform across CAD packages is
Rosetta [1]. It worked with Rhino and AutoCAD, and you could get it to work
with others.

[1]
[http://web.ist.utl.pt/antonio.menezes.leitao/Rosetta/tutoria...](http://web.ist.utl.pt/antonio.menezes.leitao/Rosetta/tutorials/introduction.html)

~~~
app4soft
Take a look on _VisualScriptCAD_ too.[0]

[0]
[https://github.com/kovacsv/VisualScriptCAD](https://github.com/kovacsv/VisualScriptCAD)

------
rowanG077
What are advantages of this compared to openSCAD or CadQuery? Specifically I
ditched openSCAD for cadquery because it can't export to brep formats like
STEP.

~~~
snarfy
I'm not sure it's an advantage, but it's nice to see an alternative
implementation of CSG. OpenSCAD depends on CGAL. CadQuery depends on CASCADE.
This depends on neither as far as I can tell.

~~~
rowanG077
exporting true brep is not an advantage? All CNC shops I talk to require a
brep based file. Software that allows you create technical drawings also
require that file format.

~~~
Max-q
I think the answer is to your question, not the sentence after your question.

------
rurban
It got a very crazy build system, and uses it for all its dependencies. It
uses some kind of special IDE with compilation rules for msvc and gcc, no
configure/make, no cmake.

In this stage it has no chance of being packaged. I started converting it to
autotools, but it's long way to go.

------
dang
Since the project hasn't been discussed on HN before, we changed the URL from
[https://github.com/arnholm/angelcad/releases/tag/v1.4-00](https://github.com/arnholm/angelcad/releases/tag/v1.4-00)
to what appears to be its home page.

------
regularfry
Looks very similar to OpenSCAD to me, only with a slightly more procedural
language.

------
corty
Looks like OpenSCAD. Any known relation there?

------
strags
Curious as to why they'd base this on AngelScript (which I had not heard of
before today) instead of a more widespread language like Python?

~~~
cacb
Because I wanted a strongly typed language that among many good things
provides the opportunity for better error messages. Also, the AngelScript
compiler is 100% embedded in the application and does not rely on an external
environment like Python does. This makes it very easy to install and use
AngelCAD.

I know Python is popular, and there is nothing to stop you from developing an
alternative front end in Python or any other language of your liking, and
still use the AngelCAD boolean engine, just implement the xcsg protocol
[https://github.com/arnholm/xcsg/wiki](https://github.com/arnholm/xcsg/wiki)

------
andybak
[https://arnholm.github.io/angelcad-docs/](https://arnholm.github.io/angelcad-
docs/)

> AngelCAD is a powerful open source 3D solid modeller based on the
> Constructive Solid Geometry (CSG) modelling technique, expressed in the
> AngelScript language. The software creates 3D models in STL or other file
> formats.

However - I can't see if there's anything out of the ordinary about the app.
I'd like to have seen some info on what makes this exceptional.

~~~
dang
We've changed the URL to that now from
[https://github.com/arnholm/angelcad/releases/tag/v1.4-00](https://github.com/arnholm/angelcad/releases/tag/v1.4-00).
Thanks!

------
rowanG077
What is it? Neither the readme or the linked page make clear what this even
does.

~~~
adinisom
This seems a little more informative:

"AngelCAD is a powerful open source 3D solid modeller based on the
Constructive Solid Geometry (CSG) modelling technique, expressed in the
AngelScript language. The software creates 3D models in STL or other file
formats." ([https://arnholm.github.io/angelcad-
docs/](https://arnholm.github.io/angelcad-docs/))

