JavaScript
-
This was a fun one. It was really only a single line of code but I decided to embellish it a bit to make it a bit more useful. The "task" I set myself was to open a web-page – this blog, in fact – inside AutoCAD as an MDI child. AutoCAD can now host web-pages directly inside its MDI frame – the New Tab Page is a great example of that – and this mechanism can be used for external applications, too. You can also load non-HTML documents into the frame, but it's quick and easy to use HTML.…
-
The "call for proposals" for AU2014 is going out on April 23rd and will remain open for about a month. This is approaching quickly, so get your thinking hats on if you're considering submitting a class proposal. From my side I'm thinking about a few possible topics: Implementing a tangible user interface for AutoCAD using SensorTag Integrating a web-based user interface into AutoCAD via its JavaScript API I'm also toying around with the idea of doing a kind of "meta" session, during which we'd look at some of my favourite blog posts/areas of research over the years. Something like "8…
-
We first introduced a JavaScript API into AutoCAD as a "preview" in the 2014 release. Take a look at this post for more details on this implementation. In the 2015 release the API has matured in a number of key ways, making it really ready for primetime usage. Firstly it's been made much more robust: rather than having a single instance of the browser executable hosting the various bits of JavaScript code running inside AutoCAD, we now use separate instances of the browser – which in turn hosts the Chromium Embedded Framework (CEF) – for each application. Which means that…
-
It's been a really interesting and productive few days here in Tel Aviv. In a sense it was too short a trip – I was penned in by commitments during the weekends either side of it – but despite that a lot was achieved. I didn't get to see very much of the city – apart from the hotel, a restaurant, some nice lunchtime eateries and a bar or two – but I'll definitely try to come for longer, next time around. After arriving on Tuesday and meeting with the people I'd be working most closely with during the course…
-
The Tinkercad team have been busy enabling an interesting new capability in their product called Community Shape Scripts. As I've mentioned before, for some time it's been possible to make Shape Scripts public for other Tinkercad users to inspect and learn from, but now it's even easier to share – and to discover – interesting Shape Scripts. You still need to select the "Share Code'" option inside the script's properties – if you want to share the implementation details with the community – then once you have the Shape Script just as you want it to be shared, simply click…
-
So after several posts leading up to the big reveal, as it were, in today's post we're going to see the full "De-skew Raster" application in action – and give you the complete source to fool around with. The main addition over where we were in the last post is the HTML5 and JavaScript UI implementation, as well as the new C# command – called DESKEW – that loads and displays it: Our JavaScript code uses the new JavaScript API in AutoCAD 2014 to execute the other command (DESKEW_IMAGE, which we saw implemented last time) that drives the core Python…
-
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…
-
After my initial fooling around with combining the Leap Motion JavaScript library with Paper.js – and some gentle prompting from Kerry Brown – I started looking at how it might be possible to integrate Leap Motion support into the Meta Balls and Voronoi samples from the Paper.js website. These are both somewhat more complex samples, with Voronoi requiring an external JavaScript library. As usual with the Paper.js samples the posted versions are coded in PaperScript, so I realised I was wrong about needing to code in pure JavaScript to integrate LeapJS with Paper.js. Happy days! 🙂 Anyway, so it turns…
-
Today marks the public release of the Leap Motion controller: people who pre-ordered devices will start to receive them today, so it seemed a good time to post something related to it. Last week I came across a really interesting JavaScript library called Paper.js. According to its website, it's "an open source vector graphics scripting framework that runs on top of the HTML5 Canvas. It offers a clean Scene Graph / Document Object Model and a lot of powerful functionality to create and work with vector graphics and bezier curves, all neatly wrapped up in a well designed, consistent and…
-
After working out how generally to use Brandon Cole's Shape Script code to display mathematical shapes in Tinkercad, I carried on looking for some interesting functions to "plot". I ended up finding definitions for two Cinquefoil knots, specifically the (2,5) and the (5,2) variations (I also tried the (5,1), but that ended up looking just like the (5,2)). This "page that once was" helped a great deal with the underlying formulae, as of course did the online derivative calculator (Brandon tells me he personally used Wolfram Alpha to calculate his derivatives, a site I've blogged about in the past). Here…