jimy-byerley/pymadcad
关于
Simple yet powerful CAD (Computer Aided Design) library, written with Python.
科学与工程可以做什么
- 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
实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +2
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
PyMADCAD
Mechanical design as code -- a Python CAD library for engineers who prefer scripts and automation over clicks.
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

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))

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)])

See the examples/ folder and the guide for more.

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 
Copyright 2019-2026 Yves Dejonghe [email protected]
Distributed under the LGPL-v3 license.
探索相关项目
加载中…