CNC, Maker, Programming, Woodworking, X-Carve

Generating and Cutting Halftone Images on the X-Carve

Halftone is an app I’ve written for making halftone-style carves with Inventables’s Easel CNC design platform. A halftone image uses different sized dots to represent light and dark areas.

Upload an image, and Halftone will convert it to a grid of holes with each hole sized to reflect the brightness of the image at that point. Darker areas are represented by wider holes; if you’re going to backlight your carve, you can invert it and have lighter areas use wider holes.

Continue reading

Standard
Clockback, PHP, Programming, Web Applications

Run Your Own Open-Source Timehop

I like the idea of Timehop: seeing all of the photos I took on this day in years past. I don’t like the idea of sharing all of my photos with a third party, so I built an open-source replacement for Timehop that runs on my own computer and server; it’s called Clockback.

Clockback is two things:

  • a BASH script that uploads all of the photos I took this week in previous years
  • a single-page web app that displays the photos from this day:

To use Clockback, you only need two things:

  1. Your photos organized so that their filename begins with the date on which they were taken, e.g. “1969-07-20 – Moon landing.jpg”. (I use iPhoto Disc Export to do this.)
  2. A Web server to upload them to.

As long as you can run the script included in Clockback once per week from your computer, the Clockback webpage will have photos to show, and it will remove old photos, so it doesn’t use a lot of disck space.

To get the code and all of the details on how to run Clockback, check out the README in the GitHub repo.

Standard
CNC, JavaScript, Programming, X-Carve

Turn Your X-Carve into a Plug Cutter

One of my favorite aspects of Inventables’s X-Carve CNC router is Easel, their free online carving software. My favorite part of Easel is that it is programmable — you can write apps for it. Apps automate tasks like turning an image into a puzzle, carving gears, or making inlays. Inventables has written nine apps and published another 14 from independent developers, and today, they’ve published my first app, Plug Cutter.

Plug Cutter turns your X-Carve into (wait for it) a plug cutter. What’s a plug cutter? It’s a woodworking tool that creates short dowels that you can use to cover screw holes. Here’s one that Rockler sells for cutting 1/4″ plugs ($16.99):

The Plug Cutter app turns your X-Carve into a plug cutter that can cut plugs in any size. The only constraint is your imagination (and the size of your X-Carve) (and the known diameter of the universe)!

Choose your plug quantity, diameter, and depth, and the app will organize them on your workpiece to minimize waste.

This is what the plug layout shown above looks like after it has been carved:

And this is what the plugs look like once they’ve been put into use:

The app itself is written in about 170 lines of JavaScript. It supports working in inches and millimeters, and it shows the exact cut that the X-Carve will make, depending on your current bit diameter.

You can see the Plug Cutter app’s sourcecode on GitHub, and if you have an Inventables account, you can try the app in Easel by clicking the Apps button and scrolling down until you see Plug Cutter:

If you try it out, post a shot of your plugs in the comments!

Standard
Alexa, Amazon, Programming

Activity Book: An Alexa skill for bored kids

Do you have an Amazon Alexa-enabled device? Do you have children? Are those children ever bored? If your answers were “yes,” “yes,” and “yes of course all the time,” then do I have an Alexa skill for you!

It’s called Activity Book. Enable the skill in your Alexa app (or by saying, “Alexa, enable the Activity Book skill,”) and then tell your kids to say, “Alexa, open Activity Book” (or more accurately, “Alexa, tell Activity Book I’m boooooooooored.”). Alexa will then give them something to do. Examples include:

  • “Why don’t you count the wrinkles in your elbow?”
  • “Climb a tree, but be careful. You don’t want to break any limbs.”
  • “Make up a secret handshake. After you teach it to someone, celebrate with a secret milkshake.”

The list of suggestions is long, ever-increasing, and appropriate for all ages.

This was actually the first Alexa app I wrote, back before Amazon allowed skills targeted at kids. I’m glad that they decided to support kids skills solely so that they could approve Activity Book. You humble me, Amazon!

The Activity Book code is open-source and available on GitHub.

Standard
API, Programming, WordPress

Share an iPhoto Library on the Web with WordPress

I recently needed to publish the contents of an iPhoto library online, so I wrote a script that converts the library to a WordPress site using WordPress’s REST API.  The script is available in my iPhoto-WordPress-Export repository on GitHub. Check it out, and then run it like this:

$ ./iphoto2wordpress.php --library=/path/to/photo/library --wordpress=https://www.example.com/

After prompting for a username and password, it will upload all of the library’s photos to the specified WordPress site. For each event in the library, it creates a post that includes a gallery containing all of the images from the event.  It will also convert any albums into categories, categorizing the photos themselves, not the posts. (For this to work, you will need to enable categories for attachments.)

If the script stops for any reason, you can restart it, and it will pick up where it left off. Depending on what it was doing when it stopped, you may have an orphaned attachment in your Media.

Posts are created as drafts and left for you to publish at your leisure.

I used this script to create DavidTewes.com.  (For back-story on what that site is and how it came to be, see this post.) Because the site is image-centric, I chose a photography based theme called Silvia, and I made a few adjustments to it:

I could have had the script automatically assign a featured image to each post, but I chose to make that decision manually. Here’s the end-result:

Let me know if you have any questions, and if you use the script, leave a link to the site you used it on in the comments below!

Standard
Camera, Photography, Programming, Technology

Putting 1940s Kodachrome Slides on the Web

When my wife Christina and I were cleaning out her late father’s garage, we came across two cases of Kodachrome slides that included nighttime shots of downtown Minneapolis in the 1940s and 1950s, pictures of daily life in nearby Hutchinson, Minnesota, and some World War II photographs, like this one of a group of soldiers celebrating on Attu Island in Alaska on V-J Day.

We determined that the photographs were taken by David Tewes of Hutchinson, Minnesota, Christina’s first cousin twice removed. He died in 1991, and her dad had likely come into possession of the slides then. They sat untouched in his garage attic for twenty-five years.

I wanted to scan the slides so they could be preserved and shared, but we had to get them back home to Oregon first. Fun fact: if you pack cases of slides in your carry-on luggage, your bag will get special attention from a TSA agent since the X-ray machine can’t see through the slide case.

Internet research showed me that there are generally two ways to digitize old slides: either use a slide scanner, or get a macro lens and take a photo of each slide at 1:1 magnification. I couldn’t find a slide scanner in my price range, so I paid $40 to rent a macro lens from LensRentals.com and set up a rig for “scanning” all of the slides.

The slide holder is three pieces of hardboard sandwiched together with a cut-out in the middle for the slide to fit into.

I back-lit each slide with a very bright lamp, and I added a paper shade around the slide to prevent my eyes from getting burn-in from the lamp bulb.

Here’s an example of what one of the slide photos looks like, overexposed so you can see the labeling that David added on each slide.

I took four photos of each slide at decreasing shutter speeds (in raw format) and then chose the best one. I cropped and captioned all of the photos in iPhoto and organized them into events matching how David had organized them in his slide cases.

In order to get the slides from iPhoto to the Web, I wrote a script that uploads an entire iPhoto library to a WordPress website. It creates a post for each event and then adds all of the event’s photos to a gallery in the post. I will publish a standalone post soon with details about that script.

The result of all this work is DavidTewes.com. It contains 650 photos organized into 51 posts, with dates ranging between 1944 and 1955. All of the photos are licensed under the Creative Commons – Attribution license, meaning that they may be used for any purpose (commercial or non-commercial) and derivative works may be produced, as long as David is credited as the photographer. If I understand U.S. copyright law, the photos will enter public domain on January 1, 2062.

Some of my favorite albums are Attu, Alaska, This is Minneapolis, and Santa Monica. In each of those albums (and in most of the others), David created a title card, sort of like a scrapbook page that he photographed to introduce the photos.  For example, here’s the title card for the photos from his trip to China Town.

There were 81 title slides; you can view them all here.

Although some of the slides were labeled with a date, many were not. For those, I’ve estimated a date but marked them as such. If you’d like to help narrow down the dates for any of those photos, you can see them all here.  Leave a comment on the photo or on the photo gallery post with any information you have, like this comment on a photo of cars from the Minneapolis Municipal Gardens.

My favorite photo out of all of them is this shot of feats of strength at Muscle Beach when it was still in Santa Monica. What’s yours?

 

Standard
OpenSCAD, Programming, Woodworking

Generating Dovetails in OpenSCAD

I’ve written an OpenSCAD library for generating dovetail pins and tails. No longer will beautiful dovetail joints be solely in the domain of skilled woodworkers; now, anyone with a 3-D printer or CNC router can participate too.

Include it in your OpenSCAD script like so:

use <dovetails.scad>;

dovetail_pins() will generate just the pins of a dovetail joint. dovetail_tails() will generate just the tails of a dovetail joint.

board_with_dovetail_tails() and board_with_dovetail_pins() are much more useful; they will generate boards with pins or tails cut into each end.

If you render dovetails.scad on its own, it will output a pair of example boards with pins and tails.

There’s a second file in the repository called dovetail-box.scad. This file is an example of how to generate all of the boards needed to create a dovetailed box, and it shows how they’re oriented when fit together.  It’s also an example of generating pins and tails of different thicknesses.

The library is available on GitHub.

Standard
Christmas, Programming

Improve your Christmas gift opening with Randomizer

My wife and I wanted to find a way to do an orderly one-at-a-time Christmas gift opening this year rather than the usual everyone-at-once free-for-all, but while also still keeping all the kids mentally present, rather than having them zone out until it was their turn.

We decided to randomly choose the next person to open a gift each time so that the kids would always have a chance to be next, keeping them on their toes. My wife suggested the sensible idea of picking names out of a hat. While she ran some errands, instead of writing down eight names on slips of paper, I wrote a one-page web app to run on our living room TV that would randomly choose who got to open a gift next. It worked perfectly, creating a mini-contest every time someone finished opening their gift, causing all of the kids to fall silent and then yell out the “winner’s” name.

The web app is called Randomizer. Give it a list of choices, and it will flip through them game-show-style (with sound effects) until finally settling on a winner. It kept the attention of eight kids between the ages of 3 and 10, quieting everyone down as soon as the beeping started after each gift was opened.

Try a demo here (be sure to un-mute your speakers), or watch this GIF screencast:

Screencast of the Randomizer in action

You can add as many options as you want, and you can weight some options more heavily by including them multiple times. The options are stored in the URL fragment, so you can bookmark Randomizer for frequent decisions. Try #Yes,No, #Heads,Tails, or #Rock,Paper,Scissors.

Continue reading

Standard