Reading (or writing!) Hackaday, we find that people are often solving problems for us that we didn’t even know that we had. Take [Jack Qiao]’s SVGnest for instance. If you’ve ever used a laser cutter, for instance, you’ve probably thought for a second or two about how to best pack the objects into a sheet, given it your best shot, and then moved on. But if you had a lot of parts, and their shapes were irregular, and you wanted to minimize materials cost, you’d think up something better.
SVGnest, which runs in a browser, takes a bunch of SVG shapes and a bounding box as an input, and then tries to pack them all as well as possible. Actually optimizing the placement is a computationally expensive proposition, and that’s considering the placement order to be fixed and allowing only 90 degree rotations of each piece.
Once you consider all the possible orders in which you place the pieces, it becomes ridiculously computationally expensive, so SVGnest cheats and uses a genetic algorithm, which essentially swaps a few pieces and tests for an improvement many, many times over. Doing this randomly would be silly, so the routine packs the biggest pieces first, and then back-fills the small ones wherever they fit, possibly moving the big ones around to accommodate.
That’s a lot of computational work, but the end result is amazing. SVGnest packs shapes better than we could ever hope to, and as well as some commercial nesting software. Kudos. And now that the software is written, as soon as you stumble upon this problem yourself, you have a means to get to the solution. Thanks [Jack]!
If there’s a science fair coming up, this trumps just about any 2D poster. It’s a 3D topographical map of an inactive Slovakian volcano, Poľana. [Peter Vojtek] came up an easy way to generate SVG topo patterns using Ruby.
Topographical data is available through the MapQuest API. You should be able to model just about any part of the world, but areas with the greatest elevation difference are going to yield the most interesting results. The work starts by defining a rectangular area using map coordinates and deciding the number of steps (sheets of paper representing this rectangle). The data are then chopped up into tables for each slice, converted to SVG points, and a file is spit out for the blade cutting machine. Of course you could up the game and laser cut these from more substantial stock. If you have tips for laser-cutting paper without singing the edges let us know. We’ve mostly seen failure when trying that.
The red model explained in [Peter’s] writeup uses small cross-pieces to hold the slices. We like the look of the Blue model which incorporates those crosses in the elevation representation. He doesn’t explain that specifically but it should be easy to figure out — rotate the rectangle and perform the slicing a second time, right?
If you’re looking for more fun with topography we’ve always been fond of [Caroline’s] bathymetric book.
[Mike] is a laser cutting newbie and has never had the opportunity to create a file and send it off to a laser for cutting. He knew he didn’t want to squint at a CAD package, nudging lines by tenths of a millimeter, only to screw something up and have to do it all over again. His solution, like so many other automation tasks, was to create a program that would generate a box of any size in .SVG format.
[Mike]’s program runs in C, and only requires a few variables set in the program to create a box of any size. There’s no argc or argv for the program – the one thing that would turn this into a command line utility that simply creates SVG boxes. Perhaps another time.
The rest of [Mike]’s hackerspace, Fab Lab xChc, was impressed the program worked the first time. With this small bit of C code, [Mike] has an easy, simple tool to generate laser cut boxes. The only remotely complicated bit of C this program uses is printf(), so even an Arduino can spit out the SVG for a laser cut box.
What if your Kindle displayed useful information as the “screensaver”? Now it can thanks to this extension of the Kindle weather display hack we covered a year ago. [Pablo Jiménez Mateo] figured out how to display time, date, weather, and tasks as his Kindle wallpaper while retaining the original functionality of the device as an ePaper reader.
The hack isn’t strictly standalone. Like the Kindle weather station hack on which it is based, you need a computer to act as the server. We see this as a good thing. The server generates a vector graphic which is used as the Kindle screensaver. This process of scraping and packaging the data is just too much for the computing power of the Kindle alone.
Now that [Pablo] got this working without disrupting the normal function of the device, you can remix the hack with your own information sources by working with the server-side code. For those that aren’t familiar with the Linux commands needed to get the Kindle ready, don’t worry. This is reasonably non-invasive. You do need to Jailbreak your device. But once you do, the steps used simply load a small script to grab the images.
We’ve seen a fair number of hacks like this one that reuse a Kindle basically just for its ePaper display. [HaHaBird] has this device hanging on his refrigerator to display the weather and remind him about recycling day. It kind of make us wonder why we’re not seeing cheap ePaper modules on the hobby market?
The concept isn’t new, but [HaHaBird] does move it along just a little bit. He started by following the guide which [Matt] wrote after pulling off the original Kindle weather display hack. It uses a separate computer running a script that polls the Internet for weather data and generates a vector graphic like the one seen above. The Kindle then loads the image once every five minutes thanks to a cron job on the rooted device. But why stop there? [HaHaBird] tweaked the script to include a reminder about his municipality’s irregular recycling schedule.
Don’t overlook the quality of the hardware side of this hack. With its prominent place in the kitchen he wanted a nicely finished look. This was achieved by building a frame out of cherry and routing passages on the back to make room for the extension cable (so it could hang in landscape orientation) and a toggle to hold the Kindle firmly in place. Additional information on the build is available here.
This temperature display may not knock your socks off, but it’s a simple demonstration of how you can used vector graphics as a web readout for data (translated). [Luca] wrote this four page tutorial to help others, he makes it look really easy, and the sky’s the limit on eye candy once you get he basics in place.
The first step is to create the dynamic SVG (vector graphic) file using Inkscape that will be used by the webpage. This starts with a static background, in this case the grey parts of the thermometer which will not change. Over the top the blue parts were added, with just a bit of XML editing to give those parts a hook which will be used in the next step. The demo above will have a moving blue bar and changing numeric output to match data coming in from a temperature sensor.
An SVG file is just a text file that is rendered as a graphic when loaded. [Luca] shows you how to used the identifiers set up when making the graphic to dynamically change the size and value of the blue parts with server-side PHP before sending the graphic to the browser. With that in place you just need to give the PHP file access to the data. He shows how to use the Pachube API but you could just as easily get this via serial or otherwise.
[Tinkerer] bought a small cupboard from an antique store to fit nicely into his kitchen decor. After getting it home, he realized that some of the cubbyholes had originally housed drawers. The originals were long gone but this provided an opportunity for him to make the replacements seen above.
The first design approach that popped into [Tinkerer’s] mind was to draw the pieces in an editor like Inkscape. Some consultation with others at the local Hackerspace led him to this script-based parametric SVG design tool. We jumped right in to give it a whirl, clicking on Load –> Construction (category) –> Better Box. Once you’ve chosen the script, click on ‘Parameters’ on the left column and enter the sizing you want for your box. When all values are correct, click the renter tab, then export it as a Scalable Vector Graphic.
We’ve lamented time and again about our lack of a laser cutter, so we were unable to test this out. But we can’t see why it wouldn’t reproduce the same results that [Tinkerer] achieved.