
Antimony – A fresh look at CAD software - rytis
http://www.mattkeeter.com/projects/antimony/3/
======
colomon
Okay, I'm a CAD software developer instead of an actual CAD engineer, so my
perspective may be a bit biased. But this CSG (constructive solid geometry)
idea is not in any way new. The reason it's kind of obscure now is that
spline-based boundary representation systems (B-reps) took over the market
decades ago. If you think about, say, the latest car designs, those free-
flowing shapes are pretty easy to do in B-rep, and quite hard in CSG. [1]

I've worked in CAD translators for the last two decades. Though both the IGES
and STEP file formats include CSG modeling features, I have never implemented
them. To the best of my recollection, I've never even had a request from a
customer to do so. A pity, I think they'd be fun to try to implement... and
most of the thorny bugs would officially be the B-rep geometry kernel's, not
mine. :)

[1]
[http://en.wikipedia.org/wiki/Boundary_representation](http://en.wikipedia.org/wiki/Boundary_representation)

~~~
smoyer
And Auto-CAD had a Lisp engine in the '80s ... You could automate almost any
function of the drawing system, build "macros" as well as patterns and even
alter the DXF generation.

~~~
brudgers
AutoCad got AutoLisp as an update to R6 in January 1986. AutoCad got solid
modelling in R11 with the "Advanced Modelling Extension" add-on in 1990.

The whole history of AutoCad's feature evolution is that of a successful
startup. There's an overview on AutoDesk's website:

[http://autodesk.blogs.com/between_the_lines/autocad-
release-...](http://autodesk.blogs.com/between_the_lines/autocad-release-
history.html)

~~~
creeble
I think it was release 2.18, retroactively named R6 maybe. John Walker and I
hacked up a p.d. thing called xlisp by David Betz, removing some of the best
bits (the 'X' parts) and fitting it into its own 64k 'small model' (x86)
segment. I was a bit of a lisp nut, but even I (product manager at the time
too) thought lisp as a 'macro language' for AutoCAD was a tinge crackers. Glad
we did it though!

~~~
brudgers
Yes, according to the timeline, it was 2.18, but it lists 2.1 as R6, so
despite it's huge impact in allowing the creation of tools like AEC-
Architectural it apparently doesn't get its own integer. As a scripting
language it seemed to me a pretty good choice, because sat reasonably well
with the command-line based interface in that it somewhat reflected its
<command> <argument>* format.

And of course in the 1980's Lisps were tech's "the sharing economy". One of
the reasons I went to vocational school to study drafting was to get my hands
on AutoCad to get my hands on AutoLisp to get my hands on a Lisp. In 1991, I
was doing timed Cad competitions using R10. My secret weapon was twenty
minutes writing my own "PGP" command aliases in AutoLisp with edlin before I
started drawing. That's how I won my copy of R11.

So I'm glad you did it too. Thanks.

~~~
JoshTriplett
> And of course in the 1980's Lisps were tech's "the sharing economy". One of
> the reasons I went to vocational school to study drafting was to get my
> hands on AutoCad to get my hands on AutoLisp to get my hands on a Lisp. In
> 1991, I was doing timed Cad competitions using R10. My secret weapon was
> twenty minutes writing my own "PGP" command aliases in AutoLisp with edlin
> before I started drawing. That's how I won my copy of R11.

That sounds like a great story. Would you consider sharing it?

------
IshKebab
Having used OpenSCAD, Solidworks and NX fairly extensively, I can say that
"code-based" solid modelling systems are good for some specific things -
anything that is highly parametric, for example:

* Gears and sprockets * Fasteners (nuts & bolts) * Electrical components (ICs, etc)

For anything else they aren't at all suitable. It's just a million times
easier to be able to click on dimensions _on the actual sketch_ and change
them. You're never going to see a power tool or a tractor or whatever designed
in OpenSCAD.

Few 2D drawing programs are specified in code - the only ones I can think of
are things like TikZ for Latex, and ... well there's a reason only Latex geeks
use them. They aren't very easy to use.

The main reason they exist is that it is _much_ (like 100 times) easier to
write a code-drive CAD system than a GUI-driven one.

~~~
ranit
> The main reason they exist is that it is much (like 100 times) easier to
> write a code-drive CAD system than a GUI-driven one.

The reason they exist is because they are very well suited for making changes
on the model ... on shallow and deep level. It might be easer to "click on
dimensions on the actual sketch and change them" for a few elements, but try
making a fundamental change without code.

GUI vs. code/config file preference seems to be a personal disposition not
only for CAD but for all kinds of software.

~~~
krschultz
A parametric modeler, i.e. every major CAD system in use since 1995, allows
you to specify your dimensions based on formulas that use relationships
between components. If you look at Solidworks or CATIA and think "man it must
be slow to point and click to set dimensions" you are missing how it is
actually used in professional practice.

The difference between point and clicking dimensions in those tools and how
they are supposed to be used is greater than the difference between pecking in
Notepad and being a power user in Emacs/Vim.

~~~
ranit
Exactly my point. "Based on formulas that use relationships between
components" means that they have internal language which if used well helps
enormously.

~~~
phkahler
No, it means they have an algebraic constraint solver. If you don't have this
feature, you don't really have a CAD program.

------
alkonaut
Looks nice. I have been working ten years professionally developing a CAD
program, and if I could time travel and give my ten years younger self a
single tip it would be to use a proper geometrical kernel (like CGAL) rather
than doing _anything_ with floating point.

The tree rep is very cool. It could probably render implicitly using distance
fields without even needing triangulation.
[http://iquilezles.org/www/articles/distfunctions/distfunctio...](http://iquilezles.org/www/articles/distfunctions/distfunctions.htm)

~~~
mpweiher
> proper geometrical kernel (like CGAL)

Wow, that looks amazing. Thanks for the pointer!

[http://www.cgal.org/](http://www.cgal.org/)

(Pretending to add value, it's eminently googleable)

~~~
Osmium
Does anyone know a CGAL-like library with an iOS App Store-compatible open
source license?

~~~
e12e
From the web-site it looks like it is available as a dual-license, GPL3+ and
commercial?

~~~
Osmium
Thanks, I didn't realise that. Unfortunately, I wasn't looking to charge for
my app, so a commercial license isn't feasible for me. As far as I know, GPL3+
is incompatible with the iOS App Store, so that's out too.

~~~
e12e
Doesn't that depend on how much they charge for a commercial license? After
all you're already paying for OS X and other tools?

~~~
Osmium
Certainly, but they're charging €1000+, so it isn't really an option for me.
I'll just re-write the parts I need. I'll just almost certainly do it worse,
and it'll take more time, that's all!

------
Osmium
This is really nice. Seems super easy to use, unlike other CAD/3D modelling
software I've tried before. I think a lot of software could benefit from this
'timeless' graph/node based approach, rather than most UI's which only let you
see the latest version with a long undo chain. It reminded me a bit of Bret
Victor's drawing tool[1] too.

Only problem, to me, is that it seems like a lot of work to get a UI like this
off the ground. It'd be lovely to see support of a node-based UI built into
some common UI frameworks.

[1]
[http://worrydream.com/DrawingDynamicVisualizationsTalkAddend...](http://worrydream.com/DrawingDynamicVisualizationsTalkAddendum/)

~~~
galfarragem
>>seems super easy to use

Did you try sketchup?

------
krschultz
> Antimony is a computer-aided design (CAD) tool from a parallel universe in
> which CAD software evolved from Lisp machines rather than drafting tables.

Funny, I'd be way more interested in the software engineering tools that are
inspired by drafting tables than the mechanical engineering tools inspired by
text editors.

If you spend some time with anyone proficient with the big CAD/CAE programs
you will see how efficient they are. OpenSCAD and others are familiar to
programmers so they are easier to learn, but if you learn CAD/CAE software
they make text editors feel clumsy and slow. For an added bonus, use one of
the input controllers specifically built for CAD/CAE, it opens a whole other
world.

~~~
rwallace
Drafting table style software engineering tools have been around for decades.
It turns out that the only ones programmers actually want to use are the ones
that deal with something that is actually visual/geometric, i.e. the layout of
graphic user interfaces, so those are the ones that were kept; that's how
Visual Studio got its name.

Nowadays when you need to cater to web browsers and mobile devices with a
large range of screen sizes, even those are largely eschewed because the
layout has to be redone at run time anyway. But there are still some in use by
people who work on fixed size form layouts.

------
fit2rule
Well, I thought OpenSCAD was a pretty fresh look at things:

[http://openscad.org/](http://openscad.org/)

.. with fairly similar goals - only not for architecture, but rather
3d-printig ..

~~~
niklasni1
OpenSCAD is functional (mostly), but it could have been great if they hadn't
invented their own language. Then you could have had fancy features like error
messages.

~~~
foldr
Openjscad (openjscad.org) is quite nice. I doubt it would be suitable for
anything big, but it works well enough for small models.

------
castell
First off, great work! Looks promising.

Does it use a geometric modeling kernel? e.g open source Open CASCADE
([http://en.wikipedia.org/wiki/Open_Cascade_Technology](http://en.wikipedia.org/wiki/Open_Cascade_Technology)
) ?

Two other open source CAD come to my mind that use Python as primary scritping
language: FreeCAD and the unmaintained HeeksCAD:
[http://en.wikipedia.org/wiki/FreeCAD](http://en.wikipedia.org/wiki/FreeCAD) ,
[http://en.wikipedia.org/wiki/HeeksCAD](http://en.wikipedia.org/wiki/HeeksCAD)

~~~
mkeeter
It uses a homebrew kernel based on functional representations
([http://en.wikipedia.org/wiki/Function_representation](http://en.wikipedia.org/wiki/Function_representation)).
Any function that comes out the end of the graph is rendered (as a bitmap) and
blitted to the screen.

------
eggy
I like the interface, and being a Blender3D user, I like nodes. However, I am
long AutoCad / Inventor user, and I don't see what's new. You could do CSG
modeling in AutoCad with union, difference, and intersection, and in Inventor
you have that and sketch-based parametric modeling; update the sketch, and the
model changes. Go back in the history, and change a value, and the model
changes. In AutoCad you could use AutoLisp and later VBA. So aside from the
look of the interface, and nodes vs. a history hierarchy what distinguishes it
from decades-old parametric modelers?

~~~
hugs
Compared to AutoCad/Inventor, cost and licensing are two huge differences.
Antimony is open source:
[https://github.com/mkeeter/antimony/blob/develop/README.md](https://github.com/mkeeter/antimony/blob/develop/README.md)

~~~
eggy
True, but I was addressing the 'novelty' observation made, not cost and
licensing. I do like the look of it.I just think it has been available, and is
not new. Even the tease of Lisp machine when it has python in the background,
not Lisp. For free, the now-opensource Solvespace [1] is a cool parametric
3D-modeler with STL check export and you can view some kinematic movement by
dragging a constrained link in a linkage. [1] www.solvespace.com

------
Animats
CSG driven by a hierarchy of operations is the standard approach in CAD today.
SolidWorks and Autodesk Inventor both work that way. Here's an Inventor
tutorial on modeling the wheel of a scooter.[1] I picked this tutorial because
the part and the operations used are very similar to the the Antimony
screwdriver example.

Antimony looks like a nice entry-level program for this sort of thing. It's
way ahead of mesh editors. Those are for graphics, not physical objects. In a
mesh editor, you can't move a hole cleanly. In a mesh, the concept of "hole"
has been lost.

What you get with the big expensive programs is 1) a GUI that scales well when
you need to design something complicated (people do jet engines in these
programs), 2) a constraint solver, where you can specify constraints and let
the system work out a solution, and 3) lots of additional engineering tools.
It's nice to see the low end catching up.

[1]
[https://www.youtube.com/watch?v=bLZzS1k4tLs](https://www.youtube.com/watch?v=bLZzS1k4tLs)

------
Arelius
It's neat, but really just looks like a pretty primitive version of Houdini to
me: [http://www.sidefx.com/](http://www.sidefx.com/)

Perhaps the emphasis on CAD instead of computer graphics is the primary
differentiating factor, but it's really too early to tell.

Good luck.

~~~
kragen
Houdini is proprietary, and even people whose idea of fun is getting fucked
over by proprietary software might balk at the price tag.

------
fzn
This looks _very_ interesting (from a DIYer point of view), however building
under GNU/Linux amd64 isn't seamless. (Missing --std statements in the
Makefile, notably)

I find openscad quite painful to use, I whish I learned about Antimony before.
I think this has lot of potential, as a lightweigth, intuitive, free software,
notably in the maker/diyer scene.

~~~
kragen
What changes did you have to make to get it to build?

~~~
fzn
#define M_PI and M_2_PI in three headers

add --std=c99 to CFLAGS and --std=c++11 to CXXFLAGS in Makefile

Still doesn't build, see:
[http://pastebin.com/T17kCyG3](http://pastebin.com/T17kCyG3)

~~~
kragen
Looks like a Qt version skew problem;
[http://doc.qt.io/qt-5/qjsonarray.html](http://doc.qt.io/qt-5/qjsonarray.html)
suggests that in the current Qt, the QJsonArray constructors take either zero
or one arguments, and the code is trying to invoke this one introduced in Qt
5.4
[http://doc.qt.io/qt-5/qjsonarray.html#QJsonArray-2](http://doc.qt.io/qt-5/qjsonarray.html#QJsonArray-2),
while your installation of Qt5 seems to only declare a two-argument
constructor and the copy-constructor.

You probably already knew that, but I think it means the cure is probably to
install Qt 5.4 (or the prerelease 5.5) from source.

Do you see other compile problems if you run make -k, or just that one?

~~~
fzn
After updating qt5base-dev using debian experimental, and adding -fPIC to the
CXXFLAGS, it compiled nicely :)

edit: there seems to be a slight problem with text rendering tho(only
lowercase 'a' and bullet points are drawn), see
[http://imgur.com/MiX1hvL](http://imgur.com/MiX1hvL) More of a qt5 issue I
think

~~~
fzn
Fixed it invoking as "antimony -style gtk"

According to
[https://wiki.archlinux.org/index.php/Uniform_Look_for_Qt_and...](https://wiki.archlinux.org/index.php/Uniform_Look_for_Qt_and_GTK_Applications#Qt5_styles)
qt5 attempts to be smart with guessing the desktop environment under wich it
is running.

------
panic
It's awesome how the nodes update as you drag things around in the viewer. I
wonder whether there's a way to visually specify constraints (two points are
coincident, two edges abut one another, and so on) instead of representing
constraints implicitly through connections in the node graph.

------
bhouston
This is neat, but from a usability standpoint most mechanical engineers prefer
to work with draft style sketches rather than a node-based interface. Thus it
is neat and impressive, but I am not sure it is what the consumers in the CAD
market desire.

~~~
leni536
Well this is a CAD software from a parallel universe, you wouldn't know what
those mechanical engineers from that universe prefer.

I'm a physicist and I only used one CAD software occasionally. In the CAD
software I used I had to clone primitive objects to use them in multiple
operations. If I wanted to change one dimension I had to update all the
clones. Simply the acyclic graph model works better for this than the tree
model. (Also some operations were irreversible, that was absolutely
inexcusable.)

~~~
castell
In 3D CAD it's usually a parametric geometric modeling kernel. Everything is
reversible and changeable, it usually it depends on an tree/directed graph.

------
keehun
This looks like its direct ancestor by the same author a couple years earlier!
Great work.

[http://www.mattkeeter.com/projects/kokopelli/](http://www.mattkeeter.com/projects/kokopelli/)

------
aswanson
Impressive. Wonder how long it took to develop.

~~~
mkeeter
I've been working on tools of this nature for about four years, though the
only thing that's made it through mostly-unchanged is the geometry kernel.

This grew out of my thesis work (2011-2013); in rough chronological order,
here are a few documents from that time period:

[http://fab.cba.mit.edu/classes/S62.12/people/keeter.matt/ind...](http://fab.cba.mit.edu/classes/S62.12/people/keeter.matt/index.html)

[http://www.mattkeeter.com/projects/kokopelli/](http://www.mattkeeter.com/projects/kokopelli/)

[http://www.mattkeeter.com/research/thesis.pdf](http://www.mattkeeter.com/research/thesis.pdf)

[http://www.mattkeeter.com/research/siggraph_poster.pdf](http://www.mattkeeter.com/research/siggraph_poster.pdf)

~~~
phkahler
I just ran across your thesis a couple days ago while searching on
representations for CSG. While I did not read it in detail, the representation
seemed strange to me. I couldn't see how it can represent things like
perfectly round holes.

BTW I was ray tracing CSG objects for RT chess back in 2001. Here's a
pic:[http://www.caiman.us/scripts/fw/f282.html](http://www.caiman.us/scripts/fw/f282.html)
I implemented a primitive called quadratic lathe which took 3 points on a
curve and revolved them around the vertical axis as an implicit surface
intersected with a slab to limit the vertical span. Most of the chess pieces
were created by sketching them on graph paper and putting the profile
coordinates into code.

If you want to run it, beware of potential malware from sites that have it.
Also, replace the SDL dll in there - somehow a bad version got in our original
zip. I may not have source for the game any more, but the renderer has
progressed a bit and now supports multithreading.

------
nraynaud
ok, here a very specific question: can I chamfer or fillet a specific edge
that is resulting from a CSG subtraction?

Because 3D printing supposes a very robust 3D CAD.

~~~
kragen
This is a really great question. I don’t know the answer yet. I struggle with
this problem _every day_ when I design things in OpenSCAD, because OpenSCAD
doesn't give your parametric model access to the results of the modeling
operations in any way (!!)

I think that Antimony kind of suffers from the same problem, but because it's
using distance fields rather than plain CSG, it does have a “blend” operation
([https://github.com/mkeeter/antimony/blob/develop/py/fab/shap...](https://github.com/mkeeter/antimony/blob/develop/py/fab/shapes.py#L382))
that attempts to fillet the _union_ of two shapes. Now, Antimony has inversion
(complement, more or less), and set A \ B is just A ∩ B', which by De Morgan's
Laws is equivalent to (A' ∪ B)'. So what happens if you attempt to approximate
a filleted A \ B with invert(blend(invert(A), B))? I don’t know. But damn, I’m
sure tempted to try it!

Of course, even if that works, that won’t fillet _a specific_ edge resulting
from the subtraction. It will fillet _all_ of them. Invariably, that is what I
want.

~~~
nraynaud
in mold making for example, being able to chamfer some edges and keeping other
edges very crisp (along the seam) is important.

~~~
kragen
That makes a lot of sense. I wonder if you can hack this in with a little more
CSG stuff: maybe union the blended version with some giant solid blob that
covers the crisp seam edges, and then intersect the result with the fully-
crisp version. That's a pretty indirect way to solve the problem, but I wonder
if it might work?

------
mc_hammer
looks great

instead of using a popup menu for your commands consider using a drop down
list with autocomplete -- and fuzzy matching

like sublimetext Ctrl+P.. to see a demo of this goto
[http://www.sublimetext.com/](http://www.sublimetext.com/) and see slide #4 at
the top of the page

------
Vorcin83
To add a bit of historical perspective, AutoCad could be extended through Lisp
(AutoLisp), back in the day. So I posit that this approach is nothing new and
unlikely to be what the customers of CAD packages don't already have.

~~~
castell
...and later also VBA (Visual Basic for Applications). The same goes for CATIA
v5 (VBA).

~~~
ZenoArrow
AutoCAD also allows for .NET and C++ extensions now IIRC. I have a vague
memory of JavaScript support coming soon too, perhaps it's already available.

------
willyt
This is very interesting, there is definitely a big opportunity for CAD
software that does things differently. A lot of the supposedly 'BIM enabled'
and 'parametric' CAD software in use in the construction industry suffers from
over defined and inflexible representations of real world objects, which often
fail in the edge cases. I don't think software should be defining what it
thinks a wall or a slab is or how they connect to each other, I think they
should be giving architects and engineers better tools for defining and
categorising these things ourselves.

------
leni536
OK, this is incredibly nice.

------
grogenaut
Tangentally related... if you are a student... Solid works is ~$180/year...
and autodesk software is free for 3 years from your enrollment. Haven't tried
autodesk's offerings but Solidworks is unbelievably powerful software. It's
incredible.

Guess what makes you a student? Any community college class. So go take a
welding class.

------
Xophmeister
So it's like POV-Ray[1], with a visual coding paradigm rather than purely
text-based source, optimised for CAD rather than raytracing?

[1] [http://povray.org/](http://povray.org/)

~~~
elliotf
openscad ([http://www.openscad.org](http://www.openscad.org)) which is
mentioned elsewhere in this thread is a much more direct descendant of POV-
ray.

------
rawe
reminds me of Farbrausch Werkkzeug demoscene tool (
[http://llg.cubic.org/docs/farbrauschDemos/](http://llg.cubic.org/docs/farbrauschDemos/)
)

~~~
frik
more info and kkrieger demo (just 96kb small ego shooter game):
[https://web.archive.org/web/20070304204422/http://www.thepro...](https://web.archive.org/web/20070304204422/http://www.theprodukkt.com/kkrieger)

------
blt
The implicit surface representation is obviously great for 3D printing. I
wonder if it would be suitable as input to a CAM system. (note: this is not a
rhetorical question. I have no idea how CAM systems work.)

------
jordigh
Huh, homebrew non-free license. I wonder if the intention was even to make it
non-free. It does not allow commercial use, which is forbidden by default.

Oh well, at least homebrew licenses are getting rarer and rarer these days.

~~~
cowsandmilk
> It does not allow commercial use, which is forbidden by default.

what are you claiming here?

~~~
jordigh
The MIT license says,

"Permission is hereby granted, [snip] including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or ___sell_
__copies of the Software "

The right to sell the software is part of the open source and free software
definitions. A license needs to specify this, because by default copyright law
does not grant this right. This homebrew license does not allow selling the
software, thus it fails to be open source.

Failing to meet this part of the definition is why MAME wasn't open source
either until last week.

~~~
cowsandmilk
What part of their home-brew license does not allow commercial use?

MAME was not free because they explicitly said "Redistributions may not be
sold, nor may they be used in a commercial product or activity."

~~~
jordigh
Anything not explicitly allowed is forbidden. That's how copyright law works.
"All rights reserved" is the default. You don't even have to claim it. All
rights _are_ reserved unless you relinquish them.

~~~
dragonwriter
> Anything not explicitly allowed is forbidden. That's how copyright law
> works.

Well, no, copyright law works by "anything explicitly made exclusive to the
copyright holder by law, and not explicitly allowed by either other provisions
of law or the copyright holder is forbidden, unless its in the rather ill-
defined -- far from explicitly delimited -- domain of 'fair-use', or
_implicitly_ permitted by the copyright holder under implicit license, or..."

------
crimsonalucard
What's the best free cad modelling tool for osx?

~~~
phkahler
>> What's the best free cad modelling tool for osx?

I've been using SolveSpace:
[http://solvespace.com/index.pl](http://solvespace.com/index.pl)

There is a Mac port but it's still on a branch. You can find a link to it in
the forum thread here:

[http://solvespace.com/forum.pl?action=viewthread&parent=586](http://solvespace.com/forum.pl?action=viewthread&parent=586)

Like the windows version it is a single executable file, so just put it
somewhere and run it. It's worth reading the reference from top to bottom.
Fantastic little program.

------
platz
The expression problem in CAD software

------
galfarragem
As an architect, I wonder how this software can be useful in the real world,
what _itch_ does it scratch?

------
poseid
interesting concepts. some examples look like graphs.

