Build123d: A Python CAD programming library
build123d is a Python-based library for parametric 2D and 3D CAD modeling, leveraging the robust Open Cascade geometric kernel. It offers a clean, fully Pythonic interface for creating precise models, appealing to engineers and makers interested in code-driven design. This 'CAD-as-code' approach promotes modern, maintainable design automation for manufacturing processes like 3D printing and CNC machining.
The Lowdown
build123d is an open-source Python library revolutionizing Computer-Aided Design (CAD) by enabling programmatic, parametric modeling. Built on the powerful Open Cascade geometric kernel, it offers a fully Pythonic interface for creating precise 2D and 3D models suitable for various manufacturing processes like 3D printing, CNC machining, and laser cutting. This library stands out for its 'CAD-as-code' philosophy, promoting maintainability and complex design automation through scripting rather than traditional GUI-based CAD.
- Core Functionality: Provides a boundary representation (BREP) modeling framework for 2D and 3D CAD, utilizing the Open Cascade geometric kernel for robust geometry.
- Pythonic Design: Features a clean, fully Pythonic API with explicit geometry classes, operator-driven modeling (e.g.,
obj += sub_obj), and deep Python integration (selectors as lists, natural conversions). - Modeling Modes: Supports two primary modeling paradigms: 'Algebra Mode' for a stateless, algebraic approach, and 'Builder Mode' for a stateful, design history-like context-driven construction.
- Extensibility: Designed for extensibility, allowing users to subclass base objects and use functional composition to create custom parametric designs.
- Interoperability: Supports import and export of common CAD data formats like STL, STEP, and SVG, facilitating integration with other design tools and manufacturing workflows.
- Community & Development: Actively developed and encourages contributions, offering comprehensive documentation, examples, and viewer integrations like
ocp_vscode. - Origins: Derived from CadQuery but extensively refactored and restructured, indicating a focus on independent development and improvement.
Ultimately, build123d positions itself as a powerful, flexible, and developer-friendly alternative to traditional CAD software. By bringing robust parametric modeling into the Python ecosystem, it empowers engineers, designers, and hobbyists to define, modify, and automate complex geometric designs with code, opening new avenues for design automation and custom fabrication.