Unit and functional testing is critical to software development, but it also extremely useful when printing 3D parts. It can significantly reduce the cycle time and material to develop a part. More importantly, it can result in a high-quality, well designed part.
“
In computer programming, unit testing is a software testing method by which individual units of source code... are tested to determine whether they are fit for use. Intuitively, one can view a unit as the smallest testable part of an application.”
When creating "unit tests" for a 3D-printed part, you want to print the smallest piece possible to validate the critical dimensions that you're worried about. For example, I recently designed a bracket (see pictures below) that mounts the bottom of the condenser to the bottom of the radiator. While not a complex part, there were several critical dimensions that I knew would take me a couple of iterations to get right. Rather than printing a full size prototype, I broke it down into "unit tests." Once the part is designed, you can usually use one or two extruded cuts to slice the completed part into something that you can use to unit test. SolidWorks allows you to suppress these cuts and save them in part file... yeah, just like software you sometimes make a change that breaks something else and the more complicated the part, the more likely it is to happen!
The picture below shows the four steps to get to the final production parts. From left to right:
- The profile of the part was printed on paper in 1:1 scale, cut out and trial fit. I needed to extend the part that touches the radiator by 0.05" and I noticed that I had room for a internal fillet.
- I made the changes and then printed a 0.025" slice in Onyx. Oops, that 0.05" should have been more like 0.04".
- After making that change I printed a section to test: (1) the part that fits into the bottom of the radiator and (2) the hole that is recessed into the sloped face. Typically I would have split this into two tests, but I already had designed a bracket for the top of the radiator so I was pretty sure I would get the right. Number one was perfect and when snapped into place it was held there by friction (I think that took me two or three times to get right when doing the top bracket). Number 2 wasn't so successful. I was able to get a washer to sit flush in the recess after using a utility to carve the sides a bit so I increased the diametera bit.
- Final print.
I | Material | Print Time (Minutes) |
---|---|---|
1 | 1 Sheet Paper | 0.1 |
2 | 0.21 cm³ Onyx | 5.0 |
3 | 4.14 cm³ Onyx | 34.0 |
4 | 25.02 cm³ Onyx | 153.0 |
The value of the unit tests becomes apparent when you look at the amount of material and time for each iteration. The savings become even more dramatic for a larger or more complex part. I got to an optimal part (at least in my mind LOL) in a small number of iterations. Having a 3D printer in the garage made that a fast and easy process. If I had to send the part out to be printed the elapsed time would have been much longer and the part not as good. Less iterations means less chances to tune the part and you're likely to say "good enough" much sooner than you would with a short cycle time. My recommendation is that if you're going to design a bunch of 3D parts to at least get an inexpensive printer so that you can quickly iterate designs and then have the final part printed by someone else with a high-end printer.
Setting | Unit Test | Default |
---|---|---|
Fill Density (%) | 1 | 50 |
Wall Layers | 1 | 2 |
Roof & Floor Layers | 1 | 2 |
Layer Height (mm) | 0.2 | 0.1 |
The unit tests were printed with the settings to to reduce time and material. The table below shows the settings that I used for the unit test vs. the system defaults:
The unit test parts can also be useful for destructive testing. If it's strong enough when printed at unit test settings, then it's going to be more than strong enough in the final print. In addition the final part was ~2.5x wider and has an additional screw, which provides a lot of margin.
Well that didn't work for this part. It was pretty easy to break the one-inch wide, crappy print. After going to install the final part I decided that the part overhung the bottom of the radiator by 0.06". It doesn't affect anything except my OCD. So I decided to destruction test that one. I had to get a bigger set of pliers to break it and it broke where you'd expect it to break. It's strong enough as is and don't I think that I'm going to use any continuous strands in the final-final print. That said, given the print orientation the continuous strands would be optimally oriented and I could make that axis as strong as a solid aluminum piece.
...yeah, like software you can keep just tweaking it...