Mar 15, 2017

BlocksCAD 104: 3D Modeling a Multi-compartment Box with Code

BlocksCAD combines two of my favorite things: Coding and 3D Modeling. I've written about BlocksCAD before - to show the basics of how code can be used to produce 3D Models - and more recently I found a real world use for this tool that I just had to share.
Note: This is basically the 4th in a series of posts about modeling with BlocksCAD. The first is here.


A while back I created a small "Battery Holder Box" - which was specifically designed to hold one type of button battery - the CR2032. This small battery has specific dimensions, so my 3D Model was made to fit that specific battery. I made a single model with specially sized compartments to hold 10 of these batteries.

About a week later, I needed another similar box to hold LR44 batteries, which are slightly different dimensions than the first - so I went through the painstaking process of reproducing the battery box to those dimensions.

Then a few weeks after that, I wanted a similar box to hold SD cards - and again, I grimaced while I considered repeating all the steps to create a specially sized box to hold a dozen SD cards. Then it struck me - I can CODE THIS!

The Power of BlocksCAD

As a software engineer, I'm trained to recognize patterns like this - and it's exciting when a pattern as obvious as the above can be turned into code. That's what BlocksCAD lets me do! Using code to produce storage boxes like this, I can use parameters (variables) to change the measurements in my code, and within seconds, have practically ANY size compartment and box configuration!

How I Made AnyBox - an overview

I'm going to give you just the basics here - I won't describe every line of code (or, in this case block of code).

I start by creating ONE compartment. It's basically a hollowed out rectangle meant to hold something - a box. From there, I simply make a bunch of those compartments by repeating the same code as many times as necessary. I do this in two dimensions - so I can have, for example, 3 across and 4 down, or 1 across and 3 down - similar to what a book case might look like. Once the boxes are done, I create a TOP - with the exact configuration of n across and m down as the boxes, but with a more flat extrusion vertically.

That's the high level story - below is the detail...

Making the First Box

I start by creating ONE box, one compartment - using 3 variables - the width (X), the length (Y) and the height (Z). These measurements are the measurements of the INSIDE of the compartment that I wanted. So I basically measure the dimensions of the object I'm trying to hold in the box, and use those for X, Y and Z.

The "CUBE" block in BlocksCAD easily produces the cube with those dimensions. But I don't actually want a solid cube, I want a hollow cube.  To achieve a hollow cube, I have to use the TRANSFORM / MINUS block to subtract this cube from a slightly larger cube.

To decide how much larger that outer cube should be, I have another variable which holds the "Wall Thickness" (let's call that W here) of the box I want - and I add that to the original X, Y and Z dimensions to get the outer cube dimensions. Now the outer box can be defined as X+W, Y+W, Z+W.

Watch The Box Multiply

Now that I have ONE compartment successfully made, I can repeat the creation to make an array of boxes connected to each other to get the "cubby" look I'm aiming for. Remember the original reason for this was to hold several of the same item - button batteries in my case.

One of the great things about programming is that once you figure out how to do something, you can re-use the code to do it again. So in this case, now that I know how to make a box in the dimensions I want, I can just repeat the code to do it again. All I have to do is start the second box just next to the first, and then again, start the third box, just next to the second, etc.

I do this with a LOOP (in coding, it is also called "iteration") to simply repeat the running of that box-creation code over and over again, as many times as the number of boxes I want. Since I want the option to have multi-dimensional cubbies - I also need a second loop around that first loop to repeat that whole set of boxes again, making another set of n boxes next to the first set of n boxes.

This is a very common pattern in coding whenever you are dealing with any sort of array - in this case it happens to be the physical creation of a multi-dimensional array object.

Making The Box Top

Before worrying about the complicated box top needed to cover this multi-box configuration I've now created, I need to make a TOP for that ONE compartment first. To do this, I'll use the same X, Y measurements from earlier - but I really don't need the Z, as the top will be mostly a flat top with minimal depth.

I start by creating a simple rectangle which is the same dimensions as the outer dimensions of the box - that is X+W by Y+W - which accounts for the width of the box walls again. Now, instead of hollowing out, like we did for the box, this time we want to create a slightly raised, slightly smaller panel which fits snugly inside the top of the box to hold the top on. This is done by creating another rectangle on top of the first which does NOT include the wall thickness, but just the inside dimensions X and Y.

Now that we have one box compartment, we simply do the same thing we did with the box, and use a double loop to create the same number of tops connected to each other as we the box had.

Practical Addition From Testing

Along the way, of course I tested the creation of the single box, then multiple boxes in one row, then multiple boxes in an array of 2 x 3 and larger. The box was working quite well! But once I actually put objects in the box, button batteries in my case, I found a slight problem. There was no great way to get the objects OUT of the box! I had to turn over the box to get one object out, which of course dumped all the objects out.

To solve this, I added one small feature - or should I say, I subtracted something. I created a small circular hole at the bottom of each compartment  (by subtracting a centered cylinder from the base of each box) - which can be used to push objects out of their compartment when needed (using a paperclip or other small pointy object). This worked just fine!

The Missing Steps Have The Real Learning

Like with all great projects, the description above doesn't really tell the whole story. There are many details left out. I don't do this to torture you, but rather because I can't remember all the smaller tweaks and adjustments I had to make to make this project work - AND, because that is where all the learning is! If I gave you every detail, you'd learn much less than if you had to figure out some of the stuff yourself.

Chances are, in doing this project yourself, you'll discover a completely new way to do this project or perhaps invent some other cool object I didn't think about!

NOTE: this is the FOURTH in a 4-part series on making models with BlocksCAD code.
Part-1 - Making 3D Models with Code Blocks (aka Intro to BlocksCAD)
Part 2 - BlocksCAD 102 - Coding a #3D Box that Grows

Jan 8, 2017

The NewMatter Mod-T 3D Printer - reviewed and liked!

I'm not the fastest to review things - and this one is no exception. It's been about 18 months since I first saw this Mod-T printer from NewMatter - and I finally got to use it and review it a few months ago. Well, It took me even longer to mention it on my blog - but here it is!

Watch the video - or I've posted the text version below it...

I’m always looking for great 3D Printers - at reasonable prices for practically anyone - but especially for educators. The NewMatter Mod-t 3D Printer is a great find in this quest.
I first saw this printer at the NYC makerfaire in 2015, and even back then, just the look and elegance of the printer’s industrial design stopped me in my tracks. Almost a year later, I finally got to test one out for myself. The bottom line is that I like this printer and would definitely recommend it especially for people with a budget under $500.

The unboxing was a pleasant experience - a well-protected printer body, which required almost no assembly, and a well-organized set of well-labeled boxes for the minor parts that had to be assembled and the tools which come with the device.

The clear instructions direct you to their online site to get fully set up - where I had to create an account to continue. While slightly annoying, it was reasonable and worthwhile given the pleasant experience that followed. The newMatter software for set up is not web-based, it runs on windows and Mac - but was easy to get installed. After setup of the software, I was instructed to “download firmware updates” - which went smoothly.

Connecting the printer to my home wifi was mostly easy - but 5Ghz networks were not recognized so you need a 2.4 Ghz network to get up and running. There were some small bumps getting through the complete printer connection process - but within a few minutes I got through that and realized with delight that I would be able to control my printer now from a web interface, which gave super clear instructions on how to finish the printer setup. The site also has simple button controls to do things like load the filament and see the status of the printer. I mounted the light blue 1.75mm PLA filament which came with the printer onto the plastic spool holder which connects to the back of the printer, and loaded it into the hole clearly marked “filament” in the back. Then, I used the web-based printer controls to get the filament fully loaded.

My first print was something simple and small - I picked my simple pegboard hook that I know only takes about 10 minutes to print. Once I figured out how to upload my own models - which wasn’t as clear as I would have liked - but has become easier in latest updates - I uploaded my model and used the clear online controls to setup the parameters for printing. It was set a bit hot - 210C - so I lowered it to 185C and started it up.

There aren’t quite as many printing options as something like Cura for printers which require GCode to be directly loaded - but that’s the whole point of the Mod-T - to make printing simple. So the advanced options are somewhat out of the way intentionally. While there were some general usability issues with the online printing interface, practically all my main concerns have already been addressed - and while it is simple and not for the advanced 3D printing professional, it is easy to use.

At the start of the print, there was certainly lots of print bed movement - which is clearly a process to home the print bed and perhaps auto-level it - but this was not excessive - and after the printer extruded a line of filament on the side of the bed to prep for printing, my object began to print.

The fan of this printer is quite loud without the cover on, but once the cover is on, the printer is pretty quiet - so I can see how that makes it more friendly than other printers which have no enclosure.

I was very pleased with the way the model adheres to this print bed - which is clearly made of a special material which is intended to be good for this purpose. This is becoming more common in printers - and with the dozen prints I did, I had no problems with models adhering to the bed - and used no additional materials like hairspray. Note that I ONLY USED PLA - I did not attempt ABS.

The subsequent tests I did included one of my favorites - a single-print hinge. This model has a bunch of one-half millimeter gaps between parts that are intended to move freely - and you can see in the video that it printed rather well and just required a bit of forcing to freely move the hinge - almost exactly the same amount as that required when this model is printed on a printer which is literally 4 times the price of this one. I was very happy with the results here.

I also printed a few other models including a thin-walled desk organizer in the shape of my initials - which has lots of curves  - and it came out quite smooth - a great result on the first try.

While the Mod-T has a very innovative mechanical design for the bed movement, which completely avoids belts and allows the bed to easily be removed and replaced - it is not necessarily space efficient. The footprint is approximately 15 inches square with the filament spool and 13.5 inches tall. The build envelope is 6 x 4 x 5 inches - 120 cubic inches - which is pretty good for most hobby projects.

I’m not thrilled with the process of changing filament color - but that’s pretty much par for the course for most 3D printers. I’m spoiled by the ease of filament changes in the Polar3D printer.

Overall, the Mod-T seems like an incredible value for an elegant, easy to use 3D printer. While no 3D printer these days is a completely user-friendly appliance - the Mod-T comes closer than many I’ve tried and it’s elegant external design could be on display in your home or even the museum of modern art. At $399, it’s definitely one of my top recommendations for printers under $500 - and while I haven’t used it long enough to call it reliable, I would say that I’ve had no clogs, no failed prints due to adherence to the bed and generally no issues with the software.

Yet Another 3D Printed Phone Stand

I got tired of laying my phone down next to my computer - so I wanted a simple phone stand that would stand my phone upright or sideways so I could see it and use it. Of course there are likely cheap phone stands or 3D Models that would suit my purpose somewhere - but I had two reasons why I "needed" to make my own:

First, I wanted it to suit my needs and fit my phone exactly.

Second, I like to make stuff - so why pass up the opportunity to invent something new!?

Design Requirements

The basic requirement of this design was to firmly hold my phone upright without tipping over. But there were other things I had to consider in this design. Here's the full list:
  • Hold phone upright (portrait) without tipping and with firmness that let me tap the screen.
  • Hold phone in sideways (landscape) too. (hopeful on this one)
  • Have a slight angle so it is easy to see on my desk.
  • Nothing should block ANY of the screen.
  • Simple & Fast to print - no supports, flat bottom surface to grip print bed, minimal mass.
  • Able to hold phones approximately the size of my Nexus 6P with or without a case.
Things I decided not to worry about for this first design included a way to dock the phone on the charging cable or making the stand portable to fit in my pocket. As with any product, sometimes it's just as important to pick things you're NOT trying to solve as it is to pick those problems you ARE trying to solve.

The 3D Model

This one was not as simple as it looks. The requirements I had to be simple and low mass made it more of a challenge - otherwise, I could have simply used a big block (as I've seen in many other phone holders).

I started with a block. I imagined the shape I wanted to be more like a wedge, holding the phone on the front, then angled back to the bottom surface.

To get the right shape of the front which would hold the phone, I created a 3D Model of my phone - not to be printed, but to be used as a shape to SUBTRACT from the wedge block to leave behind a perfectly shaped area to hold my phone. I then subtracted a large chunk of the block from the angled front for the area where the phone screen would be seen, leaving about 5mm on each side, about 3mm thick, to hold the phone in place by the edges.

Now, as with any subtraction operation like this, the fit would be too tight if I just printed it as is - so I pushed out the insides of the phone holding area by 0.5mm on each side, and the back by 1mm.

Landscape works too!
To reduce the mass of the wedge, I wanted to cut out a large part of the back - so I made a copy of the whole wedge, and scaled it down to be a subtraction shape. I made it smaller by about 5-8 mm on each side and the part behind the phone, and then subtracted it from the back of the wedge - leaving the back of the wedge with no material at all.

The shape I got was pretty much what I imagined! I finished it up by softening all the edges with a "Filet" operation (in Autodesk 123D) and gave it a first print.

Making it more useful

Landscape is great for video watching

I measured the space for my phone with the case - so the space for the phone was actually bigger than the phone itself by a few mm on each side.

The first print actually worked well with the phone that had the case on it, as it was a tight enough fit to really hold the phone firmly. But when I removed the case from the phone, the fit was so loose, that the weight of the phone leaning against the back of the stand let the stand slide up the phone and pop off the top.

I needed to create some friction or pressure for phones without cases - I had no intention of making a new stand for every phone or for phones without cases.

I decided to try a flexible "bow" in the back - just a very thin (1mm) printed flat strap, which would be stuck into two small holes into the inside of the phone holding area - creating pressure against the back of the phone and holding in in place when there was no case on it.
This worked!

The Model is published HERE.

Jun 18, 2016

Make a 3D Printed Japanese Cord Loom (Kumihimo)

I get very excited when I see my kids doing any kind of creative project. Whether it's sewing, painting, Minecraft world building, sand castle building - even cooking. I get even more exciting if that creative activity somehow triggers a 3D printing idea. 

Project Idea 

When I spotted my daughter making a Japanese Cord bracelet using a hand-made cardboard loom, the idea of 3D Printing one was obvious.

Apparently, this is called Kumihimo, officially. There was something magical about using a cardboard Kumihimo loom to make a bracelet - but the cardboard clearly wasn't holding up too well, and I thought we could 3D Model and then print a more durable and colorful loom really easily. We set out to do just that - a basic one to start, and then perhaps we'd customize later.

all parts before subtraction
and construction

Project  Goals

The model is mostly simple looking - but there were some objectives I had to influence the model. First, I didn't want it to just be a solid disk, that would take too long to print. Second, I wanted to make it rather thin, again to influence print speed, but also to make it easy to carry. Third, I wanted it to be rather small, so it could easily fit in a pocket. 

The basic requirements are a hole in the middle, through which the threads form the finished cord, and many slots around the outer rim to hold the thread or yarn material securely.

Making The 3D Model

The ultimate shape I had in mind was like a wagon wheel. It wasn't perfectly obvious how I would achieve that at first. I realized that it would be easier to put two donut shapes together with spokes, than it would be to cut out the sort of holes I envisioned around the "wheel". 

This would take 4 cylinders. First the outer cylinder which was only 2mm high and 35mm radius. That was the outer dimension - 70mm across (diameter). Second, a 6mm radius cyleinder, which I used to cut the hole in the center. Third, a 25mm radius cylinder to cut out most of the inner material in the large cylinder. and fourth, a 12mm radius cylinder to make the inner hub. 

I leave it to the reader (that's you) to figure out the series of subtractions which resulted in two basic donut shaped cylinders - one for the outer part and one for the inner part (hub). Then, using 8 simple 2mm high rectangles, I made the spokes to connect the two donut shaped cylinders. 

To make the slots in the outer rim of the model, I simply created a wedge which I could replicate 32 times around the center of the cylinders, which were now aligned at the center, and then subtract all those from the outer rim. The outer part of the wedge was 1.6mm wide to leave enough room for thicker yarn.

Get The Model

If you want to make these, you can try to replicate the process above (lots of challenge left to the reader) or simply download my model and print away. It is not a very long print given that it is less than 2mm tall. The last resort is to buy one - lots of them on the web if you search for japanese cord loom or Kumihimo - but that takes the fun out ;)

May 15, 2016

3D Printed Event Hashtag for Google IO 2016

Back in 2008, I attended my first Google IO event - a conference put on by Google to focus on tools and platforms for developers mostly (programmers).

Since those early days, the event has grown tremendously and is now the premiere forum for Google to introduce new, innovative products for everyone, with a deep focus on platforms like Android and Chrome and developers on those platforms.

But this isn't a post about Google IO. This is a post about a 3D Printed keychain I designed to celebrate Google IO 2016.

Model design

I admit - I didn't give much thought to this design. I simply wanted to have something to give out to my friends and others who show interest in 3D Printing (if you see me there, mention this post and I'll give you one if I have any left).

I just used the Google IO 2016 hashtag that I hope everyone decides to use - so not the long version #GoogleIO2016 - but rather the shortened #io16.

To make this model, I simply created the text, using Gill Sans font (which seemed to match the font on the GoogleIO site the closest) and then made a frame to hold all the parts easily. I actually referred back to my old post about 3D Printing text to help choose the font and to consider positive and negative (cutout) designs.

Making the model slightly more interesting

This is a rather boring model, I know. To add just a bit of interest, I decided to try rotating each letter/number a bit on the y-axis.

At about 15 degrees, this looked pretty good! I simply chopped off the bottom part (underside) of each letter/number after rotating to keep a flat base, and this became the preferred design for sure.

Got an event coming up? Got a Twitter hashtag you like? Make a 3D Printed keychain to show some love!

The Model

If you've really become a fan of GoogleIO, you might want to print some of these before the event on Wednesday this week (May 18-20, 2016).
Here is the model on Thingiverse :)

May 13, 2016

3D Printed Logo for Google Keep

My newest favorite Google app is Google Keep.

It's a quick scratch pad, list keeper, note-taker, image-grabber, doodle-maker, even voice-note-taker app. It's fast and it works on every device where I need it - my phone, my kid's iPhones, and the web - and it lets you share notes with other people.

Google Keep is perfect for that shared grocery list or those quick meeting notes, or that inspirational idea keeper...

But wait - this is not an app review - this post is about the Google Keep LOGO.

Design Goals

I was simply looking to represent yet another Google app logo in a form which could be used as a key-chain or backpack charm. I've done this, as you probably know, with a few other Google Apps, so it seemed fitting to now do Google Keep, since I use the app more than once a day.

The Google Keep logo is a light bulb on a small note pad looking base with one corner turned up. One of the goals of all these logo models is to keep them simple so they print easily and quickly. In the case of the Keep logo, I had a couple of options.

The base was easy, but my options for the light bulb seemed to be either to make it just a cut out into the base, or to make it stick out vertically from the base.

Design Process

The individual parts which make the bulb and base
I started with the easy part - the base. This was a variation on the Google Docs, Sheets and Slides base - that is, a rectangle (square in this case) with a turned up corner. I did the same thing as before, creating the square foundation at about 40mm square and 4mm high, then cut off one corner and rotated it about 135 degrees to appear to be turned up.

To make the bulb, I connected a round sphere to a cylinder. I then created a smaller cylinder at the bottom of the first to represent the bottom part of the electrical connection on a light bulb. I also cut a small gap about halfway down the larger cylinder to create the slight horizontal line that the logo has. I did this using a narrow, wide cylinder and then using the subtract tool to cut it out of the longer cylinder.

Now, I had to try two variations.

On the first, I simply subtracted the whole bulb shape from the base to leave a cut-out in the base in the shape of a light bulb.

On the second, I also cut out the light bulb shape from the base, but I made that cut-out slightly larger than the bulb and placed the original bulb centered in the middle of that cut-out. I then created a simple cylindrical connector to attach the bulb-base to the logo base - so the light bulb would be connected but still appear to be floating.

On that second variation - which looked quite good - I simply had to flatten the back side of the rounded bulb so that it would lay flat on the print bed along with the logo base. I only realized this after trying to print once and having a slightly artistic looking failed result ;)

The Model

This is the first time I created a logo model with two variations - but I like them both, so I'm posting both here.

The first is the cut-out light bulb.

The second is the floating light bulb.

Both models are HERE.

Hope you print lots of these for the Google Keep app users you know!

May 4, 2016

3D Printed Piggy Bank - a Journey in Problem Solving

This is a guest post from Bethany Jones, who currently teaches a 7th grade science elective called Engineering Design in Mason, Ohio. Bethany is the mother of two tiny humans and one very energetic dog. She is a tinkerer, lover of learning and recent 3D printing enthusiast.

“If at first you don’t succeed, call it version 1.0”
This has become my motto as I have leapt headfirst into the world of 3D printing with my 7th graders. One thing I have tried to share with my students is that it’s not all about the end product, but the journey you take along the way. There is often more learning that takes place through failing than if you get it right the first time around.  

Ever since our 3D printer arrived a month ago, I have been adamant that it not just be a toy, but an avenue for creation.  I am encouraging my students to try designing something on their own that has a purpose or that solves a problem. In an attempt to show them that I was in this crazy new adventure with them, (as well as wanting to test the print size limits of the printer) I decided to make a piggy bank.

I kid you not, about an hour into the print, a group of students are hovering over the printer watching in awe and one says, “how are you going to get the money out Mrs. Jones?” Face-palm. I had forgotten to put a hole in the bottom to get the money out! 

I told my kids that we’d just have to break it open. It ended up not mattering, as this version printed with a giant mystery hole in the back. But I quickly went back to the computer and edited my model to include a money-retrieval hole in the bottom. Great teachable moment about learning from your mistakes right? 

My students and I had fun analyzing the possible causes for the other print issues and we decided to try and make the walls thicker for more support and hopefully close the mysterious hole.

The second time around, I think something went awry with the printer as everything went well until the very end. The slot on the top printed crooked and the ears  were hanging on by a thread about halfway up. Since I couldn’t find any explanation for this, I printed the same model with no edits and it worked! Third time's the charm!

I am loving the iterative process of designing, printing, redesigning and reprinting until I get something right. It is a wonderful lesson that my students are learning as well. I am finding that in a world where they may have been afraid to fail before, they are energized by the possibility that they can analyze the problem and attempt to fix it! Beyond making something cool to look at, it is something to be proud of when you can create something on your computer screen and make it come to life as a tangible object to enjoy and share with others.

*Addendum: Fast forward one day past writing this post and the poor perfect piggy version 3.0 took a flying leap off my desk and met his demise as a clean break ripped through his body, splitting him in twine. I almost cried real tears in front of my students. But looking on the bright side, as one must do to remain sane, we can now analyze broken piggy from the inside out.