Skip to main content

One language for all your CAD needs

Discord GitHub Repo stars GitHub top language Static Badge

Table of Contents

  1. What is CodeToCAD
  2. Why CodeToCAD
  3. Getting Started
  4. Supported Applications
  5. Working with the software of your choice
    1. Blender support
    2. Onshape support
  6. What's next
  7. For the developers
  8. Additional resources
  9. Support us

What is CodeToCAD

CodeToCAD is an open source code-CAD automation. It provides extendable, declarative and imperative interfaces that allow engineers and developers to write code-CAD scripts that can be checked into source control, collaborated on, and run on any supported 3D modeling software.

Why CodeToCAD?

✅ Simplified modeling interface - it's all text! No more scrolling and clicking into sub-menus to edit your models.

🔓 Not vendor locked - your models are created in an open-source language. If you want to use another software, you do not lose the features you have defined. Note: There is no guarantee that a model created for, e.g. Blender, will work right away for another software, but with some refactoring, it theoretically should!

🪶 Lightweight and portable. All you need is a text-editor to model. You can occasionally fire-up your modeling software to run your creations.

💪 Leverages existing programming languages, like Python. You can keep using the languages you're familiar with and love. There is no one-off language you and your team has to learn. Use CodeToCAD like a library or a framework.

🚦Easy version control. Your models are written in code, you can use industry-loved git to keep track of versions of your models.

💕 Built by people who believe in automation and that modeling workflows should be intuitive, reliable and most importantly free and open source!

Getting started

Pre-requisites: Python 3.10 or newer.

  1. Install the CodeToCAD PIP Package to get intellisense syntax highlighting.

    pip install CodeToCAD
    
  2. Create your own CodeToCAD python file and save it (docs):

    # my_codetocad_script.py
    # More examples can be found under CodeToCAD/examples/
    from codetocad import *
    
    my_material = Material("material").set_color(169, 76, 181, 0.8)
    Part("Cube").create_cube(1, 1, 1).set_material(my_material)
    
  3. Watch as your code gets seemlessly translated into CAD using our custom addon for your desired application

Material Cube

Above is the above script being run in blender using our Blender Addon below.

Supported Applications

Alpha/Beta Support

  • Blender - Digital Modeling Software

Pre-Alpha Development

  • Onshape - Product Development and CAD Software

To Be Developed

  • PyBullet - Real-time Physics Simulation Library
  • KiCAD - Electronic/PCB Design Software
  • LLM/AI based model generation
  • FreeCAD - CAD Software
  • ThreeJS - Web-based 3D Library
  • Libfive - Signed Distance Field Modeling library

Working with the software of your choice

Remember to first follow the getting started instructions

Compatible softwares

  1. Blender
  2. Onshape

Blender

Pre-requisites: Blender 3.1 or newer is required.

  1. Download a release of the Blender Addon from CodeToCADBlenderAddon.zip or from the latest release

    Note for developers: instead of downloading a release, you can clone this repository, then watch this guide to get set up - Video Guide

  2. Install the Blender Addon in the blender software import_file

  3. Import your script using the file menu > import > CodeToCAD or the CodeToCAD menu in the sidebar. import_file

Warning: Since CodeToCAD scripts are written and executed in Python, be careful when running scripts you find on the internet!

Note, you can also run CodeToCAD in Blender via cli: blender -- --codetocad $(pwd)/yourScript.py

Onshape

Coming soon

What's next

For the developers

We welcome all contributors to the project, to get started with contributing check out our Contributing guidelines

Additional Resources

Contributors

Thank you to all our contributors for their invaluable time, effort, and expertise in making CodeToCAD possible:

Support us ❤️

Any and all donations toward the project are much appreciated and help greatly:

Metadata

Release files for codetocad 0.3.1705126403

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codetocad 0.3.1705126403
File Size Uploaded Provenance Actions
codetocad-0.3.1705126403.tar.gz 37.8 kB Without provenance Details for codetocad-0.3.1705126403.tar.gz

Release files / codetocad-0.3.1705126403.tar.gz

Download URL codetocad-0.3.1705126403.tar.gz
Size 37.8 kB
Tags Source
SHA-256 checksum
How to use checksums
48e814c046ed628eb8ba15ccca0af65da00c489a7a765dd8fec9e0abd49be785
BLAKE2b-256 checksum
How to use checksums
0444d886bbfda16afda6cc15171ee9d6e99c63269a3bd20d70aa4bf82669d1c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for codetocad 0.3.1705126403

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page