Automate Mold Making with Python
A Lesson in Creating Negative Spaces with STLs and Python
I threw ChatGPT a little challenge and asked for a proof-of-concept attempt at creating a Python script that takes a 3D model in STL format (the buck) and automatically generates a negative space mold that can be 3D printed and used for hot wax copies of the original.
The code is here on GitHub.
It is run by the following command:
#python3 ./makeMold.py <inputFileName>.stl
The output will be two new STL files; they will be named <inputFileName>_mold_top.stl and <inputFileName>_mold_bottom.stl.
It defaults to a wall thickness of 10mm but can be edited in the code. In the future, I want to update the script to take certain parameters, such as wall thickness, from the user on the command line, such as:
#python3 ./makeMold.py <inputFileName>.stl —thickness 10.0
Also, I am not happy with the placement of the keys and recesses to ensure alignment, nor am I happy with where the pour spout is created. Those will be improved. But it works good enough for now.