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!

Designing a Simple Part for 3D Printing

In a previous blog I told about my new 3D printer, and showed a few photos of it printing objects that I had found online. What else can you do with a 3D printer? You can design your own items to print, and those can be anything you can imagine. They might be purely decorative, or could be functional. Here’s something simple that is functional.

Julie has a basket that stands on four metal legs. Unfortunately, the little plastic feet that went on the legs have long since disappeared, and now they scratch the floor.

Simple solution: make some protective feet.

Fortunately, this really is a simple solution. I have some filament that I can print called TPU (thermoplastic polyeruthane) which is flexible but also tough. It sounds like the perfect material for this.

I measured the leg, and it was just a little under 19mm across. So I needed to design a foot that would fit over this 19mm square leg, hold up to some use, and stay on the leg. I decided to make it 2mm thick, as that seemed like a good thickness to not be too flimsy, yet not be overkill.

I use Fusion 360 from AutoDesk for most of my 3D designing. It’s free for hobbyists, and very capable. There are many other 3D design programs that would have worked, but that’s the one I’m most proficient with at this time. Maybe I’ll switch in the future. There is a great open source 3D design program I’m interested in playing with, but for this project I used Fusion 360

How would you go about designing a foot for this? It seems like a simple object, and it is. Just a cube with a hole in it. Like this:

I won’t go into any great detail about designing this, but will give some basic steps.

  • The leg is 19mm square, and I want the walls to be 2mm thick. 19mm + 2mm on each side makes 23mm. Draw a 23mm square.
  • Extrude that up 23mm, making a 23mm cube.
  • On the top surface of that cube, draw a centered 19mm square, leaving 2mm of the original cube on each side.
  • Extrude that down 19mm, subtracting this 19mm cube from the 23mm cube. That gives us the basic shape shown above. Note that by doing this we are left with a 4mm bottom. I could have reduced the height of the 23mm cube so that the sides and bottom were uniformly 2mm, but I figured a little extra material on the bottom would just add to the wear resistance.
  • Export this object as a 3D mesh, slice it, print it, and test it. I found that it fit, but was a bit loose, and probably would fall off over time.
  • Go back to Fusion 360 and tweak the internal (subtracted) cube to 18.5mm. If you’re paying attention (you were, weren’t you?), you’ll notice that the walls are now 2.25mm thick. I didn’t see any reason to go back and adjust this, although it would have been easy to do. At this point I believed I probably had a workable foot. In Fusion 360, it looked like this:
  • Kind of square-ish with sharp edges. Fusion 360 to the rescue. I “Filleted” (rounded) all edges, inside and out, with the exception of the bottom edges, which I “Chamfered” (cut at an angle). Why do the bottom different? Because 3D printers like mine have a problem with steep overhangs, and a fillet starts out with almost a 90° overhang, whereas a chamfer has only a 45° overhang and can be printed by most printers. Because this object is so small, it probably wouldn’t have made any real difference, but it’s a good habit to form when designing objects for 3D printing. I now have this, which looks a lot like the photo at the top of the page:

I think it looks good! Export it, Slice it, Print it. Test the fit…

It looks like a winner to me. It fits snugly, won’t fall off, and will protect the floor. The color? Just happens to be the color of TPU filament I have and a color Julie likes. Which is probably why I have this filament. 🙂

Watch for a future blog on designing a more complex object using a totally different 3D design program.