AutoCAD .NET
-
As suggested in the last post, today we're going to take the results of running the code from that post and use them to generate a hollowed-out sphere. A big thanks to Francesco Tonioni, from our Product Support team in Neuchatel, who spent some time throwing ideas around on a lazy (but very cold) Sunday afternoon, contributing significantly to this post. A few minor changes to the code were needed: rather than creating the spheres at exactly the size at which they were generated by the F# code, I adjusted the C# code to multiply the radius by 0.98 and…
-
This post continues the series on fill algorithms for 3D printing by looking specifically at an Apollonian sphere packing. In the last post we got most of the way there, but today we're going to introduce a more elegant algorithm for solving the problem (with pretty impressive results :-). Many thanks to Professor Ronald Peikert from ETH Zurich for kindly providing the C++ code used to generate the F# code in today's post. The original algorithm was outlined in this paper co-authored by Professor Peikert, under the section The "Inversion Algorithm" and – as you might divine from the name…
-
So far in this series, we've looked at Apollonian circle packing using C# and also F#. The next few posts will look at solving this problem in 3D: performing Apollonian sphere packing. I've decided to stay in F# for the algorithmic side of things: it just feels a much cleaner environment for dealing with this kind of problem, and, besides, I've been having too much fun with it. 🙂 One thing I should mention, as this series is nominally about 3D printing fill algorithms: printing hollow spheres isn't at all straightforward with today's 3D printing technology, as support material is…
-
Following on from the previous post in this series, today's post completes the implementation to create a full Apollonian gasket in AutoCAD using F#. As a comment on the original Common LISP implementation, someone had contributed a more complete version which allowed me to complete today's F# version. Here's the additional F# file for the project (which I'll be providing in full at the end of the series): module CirclePackingFullFs open System.Numerics; // Use Descartes' theorem to calculate the radius/position // of the 4th circle // k4 = k1 + k2 + k3 +/- sqrt(k1k2 + k2k3 +…
-
To carry on from the last post in this series, today's post is looking at a simple, initial attempt to pack circles into a space using F#. Rather than starting from the C# code in the previous post, I decided to look for a solution that makes better use of F#'s mathematical capabilities. I came across this simple Common LISP implementation, which creates a subset of a full Apollonian gasket. [Aside from the links in the previous post, this page may also provide additional insights into programmatic approaches for solving this problem.] Here's my equivalent F# code: module CirclePackingFs …
-
Hot on the heels of the Revit and Inventor installments in this series of guides (OK, OK – perhaps not exactly hot, but then "warm on the heels" doesn't have quite the same ring to it ;-), I'm happy to announce that the previously mentioned "My First AutoCAD Plug-in" guide is now available. Stephen Preston, the author of this excellent guide, has done a great job of creating a compelling sample – which keeps your block attributes horizontal, irrespective of the block rotation – and a series of straightforward explanations to help power-users and programming "newbies" take the plunge into…
-
To follow on from the recent series on using hyperbolic tessellation to generate patterns that might be used for 3D printing, I decided to research a slightly different approach. While I found hyperbolic tessellation reasonably straightforward for generating 2D patterns, it was much harder to adapt to 3D, mainly because we'd need to create irregular polyhedra rather than just irregular 2D polygons. I had enough trouble getting my head around the 2D side of things that I decided not to go down that path for now, at least. The good news from Alex Fielder is that he's been making good…
-
To follow on from this recent topic, today's post looks at a simple script to generate various hyperbolic tessellations, laying them out in an order that makes some sense of the progressive nature of the patterns that can be generated using the HT command. Here's an AutoCAD script (which can be saved as an .scr and executed using the SCRIPT command) to generate all the valid {n k} patterns where n <= 11 and k <= 7 (n being the number of sides in each polygon, k is the number of polygons that meet at each vertex). The application module…
-
Following on from the post introducing this series, and the last post focused on generating simple hyperbolic geometry, this post looks at generating hyperbolic tessellations inside AutoCAD. Having "borrowed" some C++ code, last time, today we're going to borrow some Java. That's one of the great things about the C family of languages: the relatively small amount of work that's often needed to move code between environments. 🙂 This article, written by David E. Joyce, Professor of Mathematics and Computer Science at Clark University, has provided the best information I could find with regards to a hyperbolic tiling algorithm (especially…
-
As mentioned in the last post, today's post looks at how to draw hyperbolic geometry using the Poincaré disk model inside AutoCAD. This is an interesting exercise, but probably won't ultimately help us with the hyperbolic tessellations we're aiming to create: it's interesting as it will end up with us having a mechanism for mapping hyperbolic geometry onto an arbitrary circle inside AutoCAD, but as we're probably going to end up creating straight-lined segments for the polygons we use to create our pattern, it's mostly an exercise (and will probably be largely irrelevant to our end result). The tough part…