Have you ever spent too much time figuring out a difficult algorithm with AutoCAD API’s Vectors and Matrices? I feel I have. In fact, I know I have. Last year, I needed several algorithms, such as Point In Polygon, Bounding Boxes and Convex Hull. I looked up the algorithms on Wikipedia or some other computational library, and I found mostly C or C++ code doing the job.
I know these languages, but I don’t use them all the time. It also seemed like a waste of time trying to write them in C# or VB. And it looked ugly as hell. Searching a little bit further, I found that these libraries actually already exist. More importantly, they are also very extensive and Open Source! These libraries are mostly GIS-oriented, but can definitely be used in CAD calculations too. A polygon is a polygon, no?
The most important one I found is Topology Framework, this is actually a collection of libraries with slight modifications and renamings. There are several frameworks referenced by this one. And they can all be found under the Credits section.
Today, I read the following blogpost. It mentions a numerical library providing mathematical functions for .NET. I haven’t looked into it in detail, but if you’re no longer happy with the Math namespace in .NET, this might be worth checking out: dnAnalytics
I might do a post on how to use these frameworks together with the AutoCad API, so if you’re interested, let me know…