Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

pymadcad

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pymadcad

Simple yet powerful CAD (Computer Aided Design) library, written with Python

pipPyPI
Version
1.0.1
Maintainers
1

madcad-logo

PyMADCAD

Mechanical design as code -- a Python CAD library for engineers who prefer scripts and automation over clicks.

PyPI tests Documentation Matrix

PyMADCAD is a script-based CAD library where the Python script is the model. Design mechanical parts with transparent, composable geometry you can version, diff, test, and automate -- no parametric black box, no opaque GUI. It outputs triangulated meshes ready for rendering, simulation, or 3D printing.

uimadcad is the graphical frontend for pymadcad -- an interactive 3D editor with multi-view scene, script editor, and quick primitive tools. Everything you can do in the GUI, you can also do in a script.

Website · Documentation · Examples · Matrix chat

differential

Install

pip install pymadcad

Optional file format support:

pip install pymadcad[stl,ply,obj]

Quick examples

Extrusion

from madcad import *

show(extrusion(ArcThrough(+Y, Z, -Y), 2*X))

extrusion

Boolean difference

from madcad import *

m1 = brick(width=vec3(2))
m2 = m1.transform(vec3(0.5, 0.3, 0.4)).transform(quat(0.7 * vec3(1, 1, 0)))

show([difference(m1, m2)])

boolean

See the examples/ folder and the guide for more.

bearing

Features

  • Surface generation -- extrusion, revolution, tube, helix, screw, saddle, and standard shapes
  • Boolean operations -- union, intersection, difference with spatial hashing
  • Kinematic system -- joints, screw theory, mechanism simulation
  • Constraint solver -- tangent, distance, angle, radius, and more
  • Bevel & blending -- chamfer, filet, and smooth transitions
  • Standard library -- ISO nuts, screws, bearings, gears
  • File I/O -- STL, PLY, OBJ import/export
  • High-quality display -- OpenGL rendering via moderngl, Qt integration

Project structure

pymadcad/
├── madcad/      # Python module
├── src/         # Rust extensions for the python module (performance-critical operations)
├── examples/    # example of mechanisms designed with madcad
├── tests/       # all unit tests for madcad
└── docs/        # docs based on mkdocs

This python module stands as a library proposing few data structures and a lot of functions to operate them. It is mostly functional and straight forward code style The rust extension of pymadcad standard as madcad.core and is based on pyo3 and built with maturin

Development

Here are recommended ways to work with this repo

  • start by cloning the repo and setting up an environment
# clone this repository from official sources
git clone https://github.com/jimy-byerley/pymadcad
cd pymadcad

# Install dependencies
uv sync
  • build and test commands
# build the Rust extension for inplace use of madcad, add --release for bechmarks
maturin develop

# Run tests
pytest
# run tests but skip visual checks
MADCAD_VISUALCHECK=false pytest

# Build and serve the docs locally
mkdocs serve
  • package build
# build pymadcad package
maturin build --release
# just build the docs website
mkdocs build

License LGPL

Copyright 2019-2026 Yves Dejonghe jimy.byerley@gmail.com

Distributed under the LGPL-v3 license.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts