If you want to do a quick design for 3D printing, Tinkercad is pretty easy to use. Although it was briefly in danger of going out of business, it was bought by AutoDesk who have made a lot of improvements. It is possible to program and simulate an Arduino in the same tool — which always strikes us as an odd juxtaposition. However, [Chuck] shows us in the video below how you can use the same Codeblocks to automate Tinkercad 3D modeling thanks to a beta feature in the software. Think of it as a GUI-based OpenSCAD in your browser.
You have to start a Codeblocks project, and when you do you can pick a starter design or just press the button for a new design to get a blank slate. The blocks look like other Scratch-related programming languages. You can create variables, repeat groups of commands, and create items. [Chuck] mentions the starter codes have no comments in them, which is a fair critique. There is a comment block you can use.
Many of the blocks have an arrow that makes them expand so you can see all the different parameters within. This makes the code easier to read and a bit more compact than it would be otherwise. Most of it is pretty easy to figure out, but there doesn’t seem to be much documentation. For example, it took us a while to realize “edge” on the cube block was how rounded the edge is.
Of course, like any language, you can use it smart or use it stupid. Setting the parameters at the top and deriving measurements from them as the example does, is certainly a best practice. Just plugging numbers in is only a little better than using the conventional GUI. Note that you can’t flip back and forth between graphic design and blocks. What you can do though, is export your result as a Tinkercad part that you can use in a regular design.
We liked how [Chuck] drew a table in the normal way and then showed the advantages of doing it with the blocks. What we always hate with these block languages is how hard it is to delete one block out of, say, a loop. You have to grab the block you want to delete and move it, which moves everything under it as well. Then move all the blocks under that block a second time to put it back where it belongs. Then you can delete the newly-orphaned block. Too much work!