3D Printed Sundial

A few weeks ago I posted about designing and printing a simple 3D part. This post will be about a more complex object, using a different design tool.

I’ve wanted to build a custom sundial for my home for years. I have a book (actually, more than one) about designing sundials. The primary one I use is Sundials: Their Theory and Construction by Albert Waugh. This book has lots of information about various types of sundials and includes formulas for designing sundials. I have thought about designing and building a traditional sundial that would be mounted in my front yard, or maybe a vertical sundial on my garage door (which gets sunshine much of the day, but not late afternoon). But that hasn’t happened.

Now that I have a 3D printer, I decided I could make a small sundial (my printer’s print bed is only about 9″ across) using that. I searched for designs, but couldn’t find a sundial I liked in the normal places to find 3D objects to print. I found one that was OK on Thingiverse, but it wasn’t really what I was looking for. Time to design my own!

I wanted to be able to easily modify the sundial for different locations. After all, if I’m going to make a dial for myself, I’m sure I have friends that would like one. And I want to easily customize it to make different sizes.

The sundial I found on Thingiverse had the base and gnomon (that’s the piece that sticks up to cast the sun’s shadow) all in one piece, which made it rather bulky to send in the mail. I wanted something that could be made flat for shipping. So the gnomon needed to be separate from the base, but easily attached.

With all of these requirements, it seemed to me I needed something that I could specify parameters to make it easy to customize, and then based on these parameters do “a lot of math” (not actually so much, but sines and cosines, at least). This is a different way of design than using Fusion 360 or some other similar CAD program, like I did the for the protective feet in a previous blog post. I needed something that could calculate angles and create shapes based on these calculated angles. Is there such a thing? But, of course! There is OpenSCAD, “The Programmers Solid 3D CAD Modeller”. This tool is basically a programming language in which you describe shapes. You write a program, which can include parameters which are used in the calculations. Just what I needed for this project!

The first thing I did was to determine what parameters I would need, i.e., the values I would want to be able to easily change. Obviously, the latitude and longitude of the location where the sundial would be “installed” would have to be easily changeable. What else? How about the size of the base so I could designate whether the sundial would be a 3″ dial, or a 6″ dial, or some other size. Here are the parameters I came up with (as shown in OpenSCAD):

Sundial Parameters as shown in OpenSCAD
Sundial Parameters

In OpenSCAD, these are dimensionless parameters, but the sizes get interpreted in millimeters by my slicing program. So think of these as sizes in millimeters, except for the locationName, which is text, the latitude and longitude, which are degrees, and the timeZone, which is hours. So the dial described above is 120mm on a side, which is very close to 5 inches.

Here is a photo of the sundial base created by the above parameters:

Sundial Base
Sundial Base

Pretty simple, right? A Cuboid (a cube with unequal size sides) for the base, with another cuboid subtracted from it (the depression in the middle), a bunch of cuboids for lines added at various angles, and another cuboid subtracted from it where the gnomon will fit in, then some letters and numbers stuck to the top surface around the edges. Nothing to it! 🙂

And the gnomon is really simple. Just a cuboid the size of the slot it will fit into, and another cuboid to cut away the upper portion at the correct angle (the latitude of it’s location).

Sundial Gnomon

Once you print the base and the gnomon, the gnomon fits into the slot in the base:

Square Sundial Base and Gnomon

With the base and gnomon apart, they can easily be mailed in an envelope. I have sent several to friends in padded envelopes, which can be sent inexpensively, with no problems.

Of course, this all seems simple now. I’ve already done it. Actually creating the sundial took me several days of work to get it just right. A lot of that time was learning OpenSCAD (I’m still just a novice), and also deciding how I wanted my sundial to look. Not to mention getting the formulas right for the basic dial. It took some time to get the hour numbers to print correctly on the dial border. Some of the logic was like, “if the hour line intersects the top border (not the left or right borders), print on the top border (centered vertically), otherwise print on the left or right border (centered horizontally), but don’t print on the bottom border (because the location text is there).” There are still some edge cases where the numbers print in the “wrong” location (which depends on your definition of wrong), but they haven’t occurred often enough yet for me to fix the logic.

For the curious, the code for the Gnomon is:

difference() {
    translate([0,-gnomonDepth,0]) cube([gnomonBaseLength, gnomonBaseLength+gnomonDepth, gnomonWidth]); // Full gnomon
    //subtract linear portion above gnomon
    rotate([0,0,latitude]) translate([0,0,-1]) cube([gnomonBaseLength*4, gnomonBaseLength*4, gnomonWidth+2]);
}

You might recognize some of the parameters to the cube() function as input parameters above, for instance gnomonDepth and gnomonWidth. The other parameters to the cube function (like gnomonBaseLength) are calculated from the input parameters.

If you are curious about the code, or want to print your own Square Sundial, my “Square Sundial” can be found on Thingiverse at https://www.thingiverse.com/thing:4802077.

360° Panoramas (again)

In my last post, already several months ago, I promised another 3D printer post. That is still coming. It’s half written. Make that a quarter written. I’ve been sidetracked, not to mention that my laptop computer bit the dust and I haven’t yet decided what to replace it with.

My first 360° panorama post was a little over a year ago, Feb. 4, 2020, where I discussed how 360° panoramas were made and showed one from Gates Pass near Tucson, AZ. My second post on panoramas was written on March 9, 2020, noting that 360° panoramas could be displayed on YouTube.

So, what’s new with panoramas?

First, 360° can be displayed on Flickr (I knew that, but had never tried it). Here’s my first panorama on Flickr. Flickr isn’t as good at displaying these as it could be – maybe it will improve in the future. The first problem I noticed is at the very bottom of the photo – directly below the camera. There’s some distortion there that shouldn’t be. Also, it is more difficult to zoom in and out with the mouse scroll wheel, as it usually scrolls the page instead. And it was difficult to go into full-screen mode, and once there I wasn’t always able to pan around the image.

It is possible to display panoramas interactively on WordPress, but only if I pay for a “professional” level. Since I don’t make any money from this site, I can’t really justify doing that. If you wish to see my photo(s) in a better viewer, take a look at it (them) in Roundme. This photo was taken a few days ago while on a cross-country ski outing to the top of Amabilis Mountain. 11+ miles and 2000’+ elevation gain, but the views were totally worth it! What a gorgeous day we had. Here are the rest of the photos I shot that day.

You can see all of the photos I’ve uploaded to Roundme by going to https://roundme.com/@garystebbins/tours.

What else is new?

All of the 360° panoramas I have posted in the past were shot by using my DSLR camera mounted to a tripod (or, in one case, handheld). The latest two were shot from a drone from tens of feet to several hundred feet above the ground.

I got my first done 3+ years ago, but it’s a bit too big to take on a backpack or cross-country ski trip. About a month ago I got a much smaller drone that is something I can take along with me. The drone itself weighs about 1/2 pound. I carried it in my backpack on my cross-country ski trip.

Phantom 4 Pro and DJI Mini 2 drones
Phantom 4 Pro and DJI Mini 2 drones

The larger drone in the photo above is a DJI Phantom 4 Pro, and the little guy is a DJI Mini 2. Both drones can automatically shoot a series of photos to be stitched into a 360° panorama photo. I then use the program PTGui to stitch the multiple images into a panorama image.

If you are curious, the panorama image is just a regular JPEG file, although it is stretched “a bit” at the top and bottom. As mentioned in my first post, it is exactly twice as wide as it is high – 360° wide and 180º high. The right and left edges join together in the panorama viewer, and the top and bottom edges are compressed to display as a single point – straight above the camera for the top edge and straight below for the bottom edge. Some additional metadata is added to the file so that the viewer program knows how to interpret the file. Here’s what the photo looks like when viewed without a panorama viewer.

Kachess Lake Overlook

There you have it – one more 360° blog post. Next (I hope) I’ll actually finish writing the 3D printer blog I promised a few months ago. Stay tuned!