It’s insane how the years tick past. Today marks the 9th anniversary of Through the Interface. For a bit of fun, I’ve added an Easter Egg (well, actually it’s more like a Birthday Cake) to Vrok.it:
Choose the “Cake” button on the left to view a Birthday Cake modelled completely using AutoCAD. If you connect to the session using the QR code, you can see the birthday cake in stereoscopic 3D on your smartphone using Google Cardboard. Or without it, if you’re good at squinting.
In case you’re interested, the mechanics of creating the 3D text in AutoCAD were quite fun: I started with ARCTEXT – drawing the text along arc concentric to the cake’s circumference – and exploded them to get individual letters as text objects. These were then exploded using TXTEXP, resulting in a bunch of old-style polylines that needed to be EXPLODEd and have segments erased before being JOINed (multiple times, to get a minimal set of closed, lightweight polylines) and then EXTRUDEd into 3D solids.
I ended up UNIONing the various letters into a single 3D solid – even if they’re disjoint – just because that stopped our web-based viewer from culling them as easily (otherwise they were dropping off the display list, for some reason). The flames of the candles still have this behaviour, but I actually like it: it’s as if they’re flickering (especially when one is visible for your left eye but not for your right, or vice-versa). Kinda cool, but it’ll probably be fixed by the time you try it.
The candles were easy: a CYLINDER for the wax and a REVSURF for the flame which are then ARRAYed in a polar configuration and EXPLODEd to give us better model structure.
Speaking of model structure, that was the really fun challenge… I found I needed to replace the drawing’s block hierarchy with Xrefs. The 3DDWFPUBLISH command has an option to “Group by Xref Hierarchy”, but this doesn’t apply to blocks. So I wrote some C# code to process the blocks inserted into modelspace, extracting them as separate drawings before reattaching them as Xrefs and pointing to these from the original BlockReferences. A slightly scary piece of code, but I’ll go ahead and post it in an upcoming post: someone’s likely to find it useful for a similar scenario.
It certainly generated some nice results when I uploaded the resultant DWF into Vrok-it:
Anyway, that’s it for this anniversary post. Thanks, as ever, for your continued readership and the interactions that make it all worthwhile.
And with that, onwards to the big one! A full decade has to be worth baking a physical cake for. ;-)