Geometry
-
While developing the prototype ShapeShifter-AutoCAD integration, last week, it became clear that the user really needed something to look at as geometry was being marshalled across between the JavaScript hosting process and AutoCAD's address space. We might have used a standard progress bar, of course, but decided to do something a bit different: implement a mechanism to take the vertices of a mesh as they are being streamed/decoded and display them inside the drawing. For us this proved to be a 2-stage process: the vertices were brought in and displayed as red, and these same vertices – as referenced by…
-
I was up in Adelboden, this weekend, for the Men's FIS World Cup Slalom and Giant Slalom events. Yes, just watching – not participating 🙂 – although I did get the chance to catch a few much gentler slopes on my snowboard during the course of the weekend. On the Saturday – during the Giant Slalom – there was a pretty amazing incident: a young Norwegian competitor, Henrik Kristofferson, very nearly hit a television worker during his first run down. Thankfully no-one was hurt, and Henrik was very understanding about the whole thing (he was given a restart but, given…
-
In the last post, we introduced the idea of preventing object snapping on certain objects by tagging them with XData and then attaching an overrule within AutoCAD to stop it from getting osnap information for them. This worked very well for standard, single-object snap modes – such as center, quad, mid, end, etc. – but didn't work for intersection points. Intersection points are determined by calling an object's intersectsWith() method, which can thankfully also be overruled using a GeometryOverrule. Overruling this behaviour comes with a few important caveats, though: intersectsWith() can be called in a number of different scenarios, so…
-
Here's a fun one that came up as a question during the recently "AutoCAD APIs: Meet the Experts" session at Autodesk University. I promised during the session that I'd address it in a blog post this week, so here we are. But I'm splitting the post into two parts, so the more complete solution will only be available next week. The problem is as follows: we want to be able to disable osnap on specific AutoCAD objects by tagging them in some way. The solution proposed by the panel during the session (I forget by whom: it could have been…
-
Over the weekend I managed to complete the BerkeleyX Foundations of Computer Graphics class. This was really an excellent class, both in terms of the structure of the lectures and the homework assignments, which actually scaled in a non-linear way (the last assignment took as much time to complete as the previous three combined). But you were eased into it and didn't strictly need to do the last piece of homework (which was to write a ray-tracer from scratch) to get a "pass" on the course. What's nice about these MOOCs is that – in order to scale, putting the…
-
I had a little fun with the title for this post: unfortunately this one isn't a "how to" and I'm not actually going to provide a code sample. But I did want to highlight how AutoCAD's .NET API has been used for at least one exhibit at this year's Burning Man, and a very cool one, at that. I first heard about Burning Man when I was living in the San Francisco Bay Area back at (or soon after) the turn of the millennium. Our housemate back then (being British I have trouble with the term roommate… back in the…
-
I've been looking for an interesting problem to solve using MapReduce for some time now. I've been curious about the paradigm and how it can be applied to churn through large sets of data across multiple processing cores: something that's especially relevant as we need to distribute processing – whether to cores that are local or up in the cloud – in order to improve software performance. I talked about much of this when I looked at F#'s Asynchronous Workflows way back when (nearly 6 years ago – ouch). MapReduce frameworks – and there are a number out there: in…
-
I was writing up a rather lengthy post following on from Monday's when I realised I needed some diagrams. And then I realised they were going to be complicated enough to need AutoCAD to create them. And then I realised I needed to write some code to generate some of the graphics, as they were too complicated to draw by hand. 🙂 Which is what this post has ended up being about: it seemed quicker and easier to write this topic up than it was to finish the other one, which I'll hopefully publish tomorrow, if i can find the…
-
As part of the project I'm working on to deskew perspective images and insert them as RasterImage entities inside AutoCAD, I spent quite some time migrating pure Python code – a good deal of which I had to create for various assignments as part of the linear algebra class I've now finished – for it to work inside IronPython. For those of you who aren't familiar with it, IronPython is a variant of Python that works with .NET via the Dynamic Language Runtime. Making it really easy to integrate with AutoCAD. The code as it stood previously was working inside…
-
Last night I completed a really interesting lab as part of the linear algebra class that I've been studying. The purpose of the lab was to build up – and make use of – some Python code to process an image taken at a certain angle and "straighten out" the perspective of an image. The processing was done using matrix operations to translate between coordinate systems – something that's bread and butter when working with CAD, so I found it particularly interesting. Here's the image used as an example – a whiteboard with some writing that's difficult to make out…