CAD Handwheel Generator.

Windows GUI exports printable CAD handwheels.

Requirements

A naval challenge project. It is too costly for naval craft to carry extra handwheels. Each naval craft may have many different sized handwheels. As an alternative, vehicles will have onboard a computer and a 3D printer. An operator can enter in handwheel dimensions and output a procedurally generated CAD file for 3D print to replace any broken handwheels. Internet will not be available, and the program must be executable offline.

As an additional feature, allow multiple handwheel dimensions at a single time with a CSV.

Stack

C#, .NET 3.1, WPF, Python, FreeCAD.

Due to the lack of internet, the application needed to be self-contained; there can be no remote dependencies. That meant we first needed to find a parametric CAD program that could be downloaded and packaged. FreeCAD was able to do this, and allowed Python scripting to interact with a saved parametric CAD output. Based on the requirements for a Windows machine, the choice was C#.NET 3.1 (for LTS) and WPF for GUI.

Learnings

This was the first time I worked with .NET 3.1, WPF, and Python.

I worked previously with .NET Framework and WinForms. The difference between .NET 3.1 and .NET Framework was minimal. The feature that stood out most for me was the self-contained packaging. Producing a single .exe file that contained all the necessary .NET dependencies and application was fantastic, especially for this self-contained application.

I chose WPF for 2 reasons. I wanted to try it out. And it is a newer, more supported, framework. I liked the XML layout. It reminds me of Android layouts.

I chose to depend on Python as little as I could in this project. It was a necessary hook into FreeCAD, however I wanted a future developer to only need knowledge in one domain (C#/.NET). If they need to diagnose Python, it should be straightforward with little logic. The only thing Python does here is pass values into FreeCAD and call a render method.

Design Decisions

UI

I wanted the UI to look like a handwheel. I’m not sure if the operator would know what each input meant unless given context of what the measurement means among the bigger picture.

Import/Export

There is an import/export feature which saves .json files. This allows an operator to keep track of different handwheel variations. This also helped with testing to allow quick entry of valid inputs and invalid inputs.

CSV

Early on I decided to export a blank CSV with headers matching the input values. It is such a small program that documentation would be overkill. This was a feature I wanted to feel intuitive. Because there are enum values, I did choose to add documentation into the CSV with lines prepended by a # as a comment.

Parametric Input

This is what the parametric CAD file looks like open in FreeCAD.