Friday, June 26, 2015

Well, That Escalated

Though I can't say it escalated quickly... You might remember those programs I wrote a few weeks ago, to automate some task at work that I didn't really have to do more than once or twice (but it was a good, fun exercise). Well, I added some things to it, namely the ability to print output as an AutoCAD command script, to draw the defining lines and arcs of my tubes, and as an AutoLisp program, to generate a 3D model of the completed set of tubes. (See the picture below, where my program's results were run through AutoCAD: script on the left side, and lisp-based model on the right.) Anyway, that was an evening of coding here, a few hours on the weekend there...

After I got that working, I thought it would be a good idea if I could access the program via web browser, in other words turn my programs into a CGI script -- what I actually did was write a shell script to act as a "wrapper program " for my other programs, and accessed that via CGI. Some more weekend time burned, some learning curve here and there (I also cleaned up the programs themselves, added error checking and made them more robust in general), and my little extra project worked!

It is up and online, and you can check it out here --  though the input might not make sense if you're not familiar with the problem (which I've been deliberately vague about), and the results are not very useful without AutoCAD. But there it is, and I've been playing with it at work, just to watch how quickly it runs -- seconds, instead of half a day to do it "by hand" -- and how quickly the results draw themselves.