Over the past month and a half, I took my first real foray into CAD/3D modeling.
My buddy Bryant and I were gawking at the new GPD Pocket 4 that came out last year, and when it showed off the HDMI input capabilities it has, we flipped out! He said he'd try making a cyberdeck of his own. I thought if I wanted a small device running Linux, I would want something more like the ClockworkPi uConsole, and so we each set out to make the cyberdeck of our dreams. Like all CS students, I had a spare Raspberry Pi 4 lying around, and I figured it was about time to give it some love.
I looked around MakerWorld for some inspiration, and stumbled upon this awesome model by crisicksix (I'm gonna call him Chris). I printed out the parts, and decided that I would buy the display and keyboard he used, although I knew I would be making some modifications to the shell.
After the parts arrived, I did some ideating, and eventually decided that what I wanted was too different from Chris's model, so I would have to model it from scratch. I asked some friends what software they recommend for CAD; many mentioned OnShape, but I was more interested in something that gave me full ownership of my work. So, I watched some tutorials on FreeCAD and put together a nice-looking model for my first prototype.
On my shell's first print, none of the holes lined up for the Raspberry Pi's ports! I knew something like that would happen; it was my first try after all. I kept refining the model, but started to feel a little bit discouraged with FreeCAD. It was an amazing introduction to parametric constraint-based modeling, but its UI was always flickering, and the variables felt really clunky to work with.
One morning, I stumbled upon Hackaday's article about MicroCAD, and I was instantly interested. After taking a closer look, it seemed that MicroCAD was still in pretty early development, but the article also mentioned OpenSCAD, which I had never heard of before. I gave OpenSCAD a shot, and felt immediately relieved of many gripes I felt with FreeCAD. It even let me use an external text editor with live reloading!
Over the Christmas break, I had my tonsils removed, and I took all the recovery time in bed to redo all of my FreeCAD work in OpenSCAD. By then, the hard work (getting accurate measurements) was pretty much done, so it ended up being pretty quick. Getting line-by-line version history in Git was a welcome perk of it being fully text-based!
Within only a couple of days, the OpenSCAD rewrite had far surpassed the amount of features of my latest FreeCAD version. I finished the project and dolled up its GitHub repository.
At the end of this project, I felt that switching to OpenSCAD was an unmitigated success and a worthwile effort. However, that doesn't mean that the language was without quirks. There was plenty of stuff that it lacked, such as introspection and fillets (which there were alternatives to). It also didn't have a very consistent way of passing parameters to modules. If a parameter was a primitive like a number or string, it could go in the parentheses, but if it was geometry of some sort, it would go into curly braces after the parentheses, and the module would have to access them with the built-in children() function, which didn't make much sense to me. Why not just include geometry in the type system?
Also, OpenSCAD is imperative and procedural, meaning that any invoked module could just call cube() erroneously somewhere and it would end up in the model. A much better approach would've probably been to enforce modules to return a single element instead of just declaring all the things it wants to display. That way, the main module could just aggregate all of the geometry from its children modules with a union(), and everything would be explicitly declared.
It should also be mentioned that in the case of OpenSCAD, I can see large and complex models becoming extremely tedious. At that point more integrated environments will end up more effective than text-based modelling. I have taken a closer look at MicroCAD, and it sure looks like an improvement over OpenSCAD! I am excited to follow its development process, and maybe someday I'll port my OpenSCAD code over to it.