Skip to content
This repository was archived by the owner on Feb 27, 2026. It is now read-only.

Lokonco/PyCAD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues CC BY-NC 4.0


Logo

PyCAD

Create 3D Print-ready files using Python scripts
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Built With
  3. Getting Started
  4. Usage
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgments

About The Project

Product Screenshot

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.

(back to top)

Built With

  • Vue
  • Node
  • Electron

(back to top)

Getting Started

Follow these steps to set up a local copy of PyCAD:

Prerequisites

You’ll need Node.js and npm installed.

npm install npm@latest -g

Installation

  1. Clone the repo
    git clone https://github.com/Lokonco/ShellHacks2025.git
  2. Install dependencies
    npm install
  3. Run the app in development mode
    npm run dev
  4. Build the app for production
    npm run build

(back to top)

Usage

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)

(back to top)

📝 File Overview of Utils

  1. 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.

  2. 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.

  3. 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.

  4. 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.

Roadmap

  • STL export support
  • Live 3D preview
  • Geometric primitives
  • AI Integration

See the open issues for a full list.

(back to top)

Contributing

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/name)
  3. Commit your Changes (git commit -m 'Add some name')
  4. Push to the Branch (git push origin feature/name)
  5. Open a Pull Request

Top contributors:

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Project Maintainers – GitHub

Project Link: https://github.com/Lokonco/ShellHacks2025

(back to top)

Acknowledgments

(back to top)

About

Turn the power of Python into your next 3D print. Welcome to PyCad a web and desktop tool where you use Python in a built-in environment to create precise 2D sketches for 3D modeling.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors