KeyForge3D is an app that turns a photo of a key into a 3D-printable STL file. Ideal for locksmiths and hobbyists, it analyzes the key's bitting pattern using image processing and generates an accurate 3D model for quick replication.
745
stars
6
commits
Python
primary language
Apr 4, 2025
updated

KeyForge3D is an innovative application that extracts the shape of a physical key from a photo, generates a 3D model of the key, and exports it as an STL file for 3D printing. This tool is designed for locksmiths, hobbyists, or anyone needing a quick way to replicate a key using a 3D printer. The app features a user-friendly GUI built with Tkinter, making it easy to upload an image, process the key, and generate a 3D model.

The app processes a photo of a key, extracts its shape, and generates a 3D model like the one shown above. The bitting code (e.g., "05624") is also displayed for reference.
KeyForge3D relies on the following Python libraries:
opencv-python: For image processing and key shape extraction.numpy: For numerical operations.trimesh: For 3D model generation and STL export.shapely: For polygon operations.pillow: For image display in the GUI.Install the dependencies using the following command:
pip install opencv-python numpy trimesh shapely pillow
Clone the KeyForge3D repository to your local machine:
git clone https://github.com/makalin/KeyForge3D.git
cd KeyForge3D
Run the App:
python keyforge3d.py
Upload a Key Photo:
Process the Key:
key_model.stl.3D Printing:
key_model.stl file in your 3D printing software (e.g., Cura, PrusaSlicer).The main script (keyforge3d.py) includes:
Contributions are welcome! To contribute:
git checkout -b feature/your-feature).git commit -m "Add your feature").git push origin feature/your-feature).Please ensure your code follows the project's coding style and includes appropriate tests.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions, suggestions, or feedback, feel free to open an issue or reach out.
6 commits
Python
100.0%
KeyForge3D is an app that turns a photo of a key into a 3D-printable STL file. Ideal for locksmiths and hobbyists, it analyzes the key's bitting pattern using image processing and generates an accurate 3D model for quick replication.
745
stars
6
commits
Python
primary language
Apr 4, 2025
updated

KeyForge3D is an innovative application that extracts the shape of a physical key from a photo, generates a 3D model of the key, and exports it as an STL file for 3D printing. This tool is designed for locksmiths, hobbyists, or anyone needing a quick way to replicate a key using a 3D printer. The app features a user-friendly GUI built with Tkinter, making it easy to upload an image, process the key, and generate a 3D model.

The app processes a photo of a key, extracts its shape, and generates a 3D model like the one shown above. The bitting code (e.g., "05624") is also displayed for reference.
KeyForge3D relies on the following Python libraries:
opencv-python: For image processing and key shape extraction.numpy: For numerical operations.trimesh: For 3D model generation and STL export.shapely: For polygon operations.pillow: For image display in the GUI.Install the dependencies using the following command:
pip install opencv-python numpy trimesh shapely pillow
Clone the KeyForge3D repository to your local machine:
git clone https://github.com/makalin/KeyForge3D.git
cd KeyForge3D
Run the App:
python keyforge3d.py
Upload a Key Photo:
Process the Key:
key_model.stl.3D Printing:
key_model.stl file in your 3D printing software (e.g., Cura, PrusaSlicer).The main script (keyforge3d.py) includes:
Contributions are welcome! To contribute:
git checkout -b feature/your-feature).git commit -m "Add your feature").git push origin feature/your-feature).Please ensure your code follows the project's coding style and includes appropriate tests.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions, suggestions, or feedback, feel free to open an issue or reach out.
6 commits
Python
100.0%