Categories
Uncategorized

Programming with OpenSCAD [Book]

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.

Categories
Uncategorized

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 Printables.com – Wyze Cam Magnetic Shelf. Print it if you need it!

Categories
Uncategorized

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 Printables.com 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 Printables.com – 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!

Categories
Uncategorized

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.)

Categories
Uncategorized

Parametric Sink Strainer / Sifter

Continuing on the journey of improving my OpenSCAD skills I worked up this parametric sink strainer for the slop sink in our basement. It’s a useful print because sometimes we clean dirty things in the sink (like muddy shoes) and keeping yard waste out of the drain is probably a good idea.

Here’s the sink drain in question. I just measure the diameter and depth of the hole and created a strainer that could fit inside.

It’s not a super snug fit so it’s easy to remove the strainer by just sliding it out when not needed.

You can also make a sifter, which is something I designed and printed before when I needed to sift the rocks out of some concrete.

You can customize the diameter, height, wall and floor thickness, and size and spacing of holes. I didn’t add the capability to switch to round holes versus square holes, but that may be an improvement in the future. There’s also no lip/edge like most strainers have, so maybe that should get added to the list as well. (Or you can check out Customizable Drain Strainer by fardog.)

You can get the .scad file from Printables.com – Parametric Strainer / Sifter. Just open in it OpenSCAD, set the size of things and render your object.