Create 3D Print-ready files using Python scripts
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This project was built during ShellHacks 2025. The goal was to make an app that generates 3D-printable object files from Python scripts. This allows makers and hackers to brainstorm 3D print ideas quickly without needing advanced CAD software skills.
Follow these steps to set up a local copy of PyCAD:
You’ll need Node.js and npm installed.
npm install npm@latest -g- Clone the repo
git clone https://github.com/Lokonco/ShellHacks2025.git
- Install dependencies
npm install
- Run the app in development mode
npm run dev
- Build the app for production
npm run build
Write Python scripts to define 3D shapes and export them as STL files ready for 3D printing.
# Example: Create a triangle
from js import send_points
triangle = [
{"x": 50, "y": 0, "z": 0},
{"x": 100, "y": 100, "z": 0},
{"x": 0, "y": 100, "z": 0},
]
send_points(triangle)from js import send_points_multi
circle_inner = geometry.generateCircle(200, 50, 25, 16)
circle_outer = geometry.generateCircle(200, 50, 50, 16)
send_points_multi(circle_inner, circle_outer)📝 File Overview of Utils
-
Node.ts https://github.com/Lokonco/ShellHacks2025/blob/ebf5ae9dd8c17a1d274cda533a5982d9cc64a26f/src/renderer/utils/Node.ts This is the foundation of your geometry system, defining the basic building blocks. It contains the ListNode class which represents individual points in 2D space with x,y coordinates, plus navigation pointers (next/prev) for linking nodes together. Each node can calculate distances to other points and includes optional metadata for storing additional information like IDs or properties.
-
CircularLinkedList.ts https://github.com/Lokonco/ShellHacks2025/blob/ebf5ae9dd8c17a1d274cda533a5982d9cc64a26f/src/renderer/utils/CircularLinkedList.ts This is a data structure for representing shapes and polygons. It manages a collection of connected nodes in a circular fashion where the last node connects back to the first, making it perfect for closed shapes. The class provides methods for adding/removing nodes, traversing the shape, finding closest points, and converting to different formats needed by the rendering system.
-
GeometryUtils.ts https://github.com/Lokonco/ShellHacks2025/blob/ebf5ae9dd8c17a1d274cda533a5982d9cc64a26f/src/renderer/utils/GeometryUtils.ts This is your comprehensive CAD toolkit containing all the mathematical operations for working with shapes. It includes area/perimeter calculations, bounding box detection, geometric transformations (scale, rotate, translate), point-in-polygon testing, and advanced CAD features like offset curves and filleting. It also provides shape generators for creating circles, rectangles, and other primitives.
-
installPyToJsSketchBridge.ts https://github.com/Lokonco/ShellHacks2025/blob/ebf5ae9dd8c17a1d274cda533a5982d9cc64a26f/src/renderer/utils/installPyToJsSketchBridge.ts This is the critical bridge that connects your Python scripting environment to the JavaScript CAD engine. It exposes all the geometry functions and drawing commands (send_points([]), send_points_multi([]...)), allowing users to write Python scripts that can create, manipulate, and render CAD geometry. It handles data conversion between Python and JavaScript formats and automatically installs all functions as Python builtins for easy access.
- STL export support
- Live 3D preview
- Geometric primitives
- AI Integration
See the open issues for a full list.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/name) - Commit your Changes (
git commit -m 'Add some name') - Push to the Branch (
git push origin feature/name) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Project Maintainers – GitHub
Project Link: https://github.com/Lokonco/ShellHacks2025
