Skip to main content

CodeToCAD

ONE LANGUAGE FOR ALL YOUR CAD NEEDS

Use one python script to interact with all these software:

  • Blender* - Digital Modeling Software
  • Onshape** - Product Development and CAD Software
  • 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

* Alpha/Beta support ** Pre-alpha development. *** To be developed.

READ THE DOCS

EXAMPLES WITH CODE

SIMPLIFY YOUR CAD WORKFLOW NOW:

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:

    # my_codetocad_script.py
    # This is also the examples/materials.py example
    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)
    

    Material Cube

  3. Run your script in your modeling software. If you are using Blender, check out the instructions for installing the Blender Addon addon below.

Release Version and Blender Addon Documentation Pages

BLENDER

Note: Blender 3.1 or newer is required.

  1. Download a release and install the Blender Addon from CodeToCADBlenderAddon.zip or from the latest Release (see the sidebar).

    If you're a developer, instead of downloading a release, you can clone this repository. Video Guide

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

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

WHAT DO I DO NEXT?

WARNING!

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

THE POWER OF CODE-BASED CAD

Benefits of code-based modeling with 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!

Metadata

Release files for codetocad 0.3.1703959257

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.1703959257
File Size Uploaded Provenance Actions
codetocad-0.3.1703959257.tar.gz 35.9 kB Without provenance Details for codetocad-0.3.1703959257.tar.gz

Release files / codetocad-0.3.1703959257.tar.gz

Download URL codetocad-0.3.1703959257.tar.gz
Size 35.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c68c845835c73f220c5d75fff99d2dde8b3cfb759b877d36177d5c91686709e4
BLAKE2b-256 checksum
How to use checksums
98f707bab5131c13458a3ffb427de1a637d7d00cc3d9909d65022e1fd501d67c
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.1703959257

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