Geometry

  • This is a follow-on to this previous post, prompted by a thread over on The Swamp discussing a recent blog post by Fenton Webb on the AutoCAD DevBlog. Fenton's assertion is that you really need to call Dispose() on all AutoCAD objects that you create yourself, unless they are managed by AutoCAD's transaction system (i.e. you've passed responsibility across to AutoCAD by calling Transaction.AddNewlyCreatedDBObject()). Which means that while you don't need to call Dispose() on objects such as the AutoCAD Editor or the active Document (and you really shouldn't), you really should call Dispose() on various objects you've been used…

  • As mentioned in this previous post, I was very keen to see how AutoCAD could be used to help streamline the process of generating what I've now found out can be classified as anamorphic street art. Leon Keer had mentioned that the technique dates back to Leonardo Da Vinci and – sure enough – Wikipedia agrees. As part of my research, I found the original video that inspired my interest in Leon's work, which should help put this post in context: To make the process reasonably realistic – and to some degree replicate the approach Leon has taken in his…

  • As we're nearing the end of this series, it seems a good time to do a quick recap of where we've been with the posts leading up to this point. Here goes… An interesting challenge: generating variable density fill patterns for 3D printing Generating hyperbolic geometry on a Poincaré disk in AutoCAD using .NET Generating hyperbolic tessellations inside AutoCAD using .NET Scripting the generation of hyperbolic tessellations inside AutoCAD Circle packing in AutoCAD: creating an Apollonian gasket using .NET Circle packing in AutoCAD: creating an Apollonian gasket using F# – Part 1 Circle packing in AutoCAD: creating an Apollonian gasket…

  • 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  …

  • 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…