Programming with OpenSCAD

I recently picked up Programming with OpenSCAD from No Starch Press. I’ve been using OpenSCAD for over 10 years, and I’ve not yet mastered it, but I’m definitely proficient at it. I’ve learned a lot of tricks over the years and I’ve created some complex 3D objects, but there’s always more to learn.

So did this book help? Yes. I read it while I was “offline” (meaning, on vacation away from home for a week) and it was good to just read a book and have a reference without being distracted by a computer. If you’re a complete newbie to using OpenSCAD, this would be a great book for you. I could still do most of what I do without ever having read it, but I feel like I picked up enough tips and tricks to make it worthwhile.

Other things to check out are the OpenSCAD Cheat Sheet, and the GitHub repo for the book which has all the code you’ll find in the book in case you want to grab any of it.


Wyze Cam Magnetic Shelf

I needed to mount my Wyze Cam to a metallic door but still wanted it upright (and not sideways) so I made a small shelf, added magnets, and stuck the metal plate that came with the camera onto it.

I used 12mm x 3mm magnets, so the pockets are for that specific size. I didn’t glue them in as they fit really well, but did add some gaff tape so they don’t fall out.

If you’re familiar with OpenSCAD you can modify the .scad file to allow for different size magnets. I seem to have a large pile of 12mm x 3mm so I just used those.

The metal plate that comes with Wyze Cam has a mounting hole in the center but also has adhesive, so I just stuck it right onto the shelf. It should stay put just fine. (I probably could have used a few washers as well, but I have a few of these plates now.)

You can get the STL and .scad file from – Wyze Cam Magnetic Shelf. Print it if you need it!


Band Ties

I needed some Bongo Ties but didn’t have any Bongo Ties, so I made some Band Ties using my 3D printer. What’s a Band Tie? Well, it’s just like a Bongo Tie, but you can print your own. Wait, what is a Bongo Tie? It’s a small piece of wood that looks like two golf tees merged, with a heavy duty rubber band attached to it.

Bongo Ties are great to use in media production. Got a photo studio, or a camera bag? You’ll probably want a bunch of them around. They are super handy for attaching cables or cords to light stands and tripods.

They’re also great for securing wrapped up cables. Bongo Ties are strong and difficult to break! (The wood part and the rubber part.) Band Ties are just plain old rubber bands, so for lightweight uses, they’re good enough.

This is one of those things I expected to find on but did not. I did find one on that dead site we don’t talk about, but I wanted one on Printables so I took the time to model one (well, two) and drop them over there.

My Prusa MINI+ printed them like a champ, and my Monoprice Select Plus printed them… not as good, but totally acceptable. I was unable to break one. It’s a fairly small object, so just getting a grip on both ends in an attempt to snap it was not easy.

You can get the STL and .scad files from – Band Tie. There are two versions, one is simplified (use that one) and one is a bit more complex code-wise and only recommended if you’re familiar with writing OpenSCAD code. Otherwise just use the STL files and print!


OpenSCAD Improvements

When writing code for yourself you can choose to leave it messy and confusing (though you may not want to) and when writing code that other people will see it may be a good idea to attempt to be clear and organized. I’m trying to be more clear an organized. Which you know, can help your Future Self as well.

Here’s a recent project. It’s a 3D model of a simple foot switch. There are two 3D printed parts (a base and a cover) and one non-printed part (a push button) and sometimes I want to see one part, and sometimes I want to see all of the parts together.

Another thing I’m hoping this helps with is that since you need to export each part individually for slicing and printing I used to just add a line that said “Uncomment this to export” above each item to be exported.

I figure this is a bit cleaner as you just need to toggle some values between 0 and 1. (And yes, you can do an export that is all parts laid out ready to print but I tend to not do that.)

Anyway, I’ve never really read up on best practices for writing OpenSCAD code. I’ve picked up things over the years from looking at code others have written, and from making my own mistakes and wanting to improve them.

If you know of any good tricks or have some tips, let me know!

Update: Someone asked why I was using 0 and 1 instead of false and true. I am not an expert on this but I believe since OpenSCAD is not strongly typed that 0 and 1 pretty much work as Boolean values and the only real difference is readability. If so, it’s really just a personal choice. (Let me know if that is incorrect.)


Walking in 2022

It’s been a while since an update. November 2021 to be exact. So how has it been going since then? Well… here’s a update.

Fall is the best time of the year. It’s cool out, not too hot, not too cold. It’s just right. Winter was, at times, brutal. I don’t have any December stats here, and that’s okay. They were probably close to November, but not quite as good. Holidays and what-not. January was also bad, but February was even worse. Now, at some point around that time I started doing indoor bike rides, so my steps are down even though my “active minutes” might have been fine.

Around April things started to drop down due to the return of plantar fasciitis. I saw my doctor for it at the end of April (as it was a daily pain thing that was getting pretty bad). I was advised to “take it a bit easier” so May was pretty light with much less walking. I also started doing some stretches and exercises, which helped a little bit, but not enough.

I eventually got a sleep support device (borrowed from my wonderful sister) and that has helped quite a bit. More than the stretching and exercises. I still get some pain occasionally, but it’s nowhere near as bad, and not even noticeable in the morning.

I’ve also been super-busy with work, so I’m not finding as much free time for walks, but I’m still doing at least one 30 minute walk nearly every day, and I’ll keep it up as long as I can.

Below is an individual look at each month of 2022, from January to June.

January 2022

February 2022

March 2022

April 2022

May 2022

June 2022