Package: codetocad
One language for all your CAD needsTable of ContentsWhat is CodeToCADWhy CodeToCADGetting StartedSupported ApplicationsWorking with the software of your choiceBlender supportFusion 360 supportOnshape supportWhat's nextFor the developersAdditional resourcesSupport usWhat is CodeToCADCodeToCAD 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 startedPre-requisites:Python 3.10 or newer.Install theCodeToCAD PIP Packageto get intellisense syntax highlighting.pip install CodeToCADCreate your own CodeToCAD python file and save it (docs):# my_codetocad_script.py# More examples can be found under CodeToCAD/examples/fromcodetocadimport*my_material=Material("material").set_color(169,76,181,0.8)Part("Cube").create_cube(1,1,1).set_material(my_material)Watch as your code gets seemlessly translated into CAD using ourcustom addonfor your desired applicationYou may also runcodetocad my_codetocad_script.pyfrom the CLI to run your script.Above is the above script being run in blender using ourBlender Addonbelow.Warning: Since CodeToCAD scripts are written and executed in Python, be careful when running scripts you find on the internet!Supported ApplicationsAlpha/Beta SupportBlender- Digital Modeling SoftwareInstructionsFusion 360- M-CAD, E-CAD and CAE Software developed by AutodeskInstructionsOnshape- Product Development and CAD SoftwareInstructionsTo Be DevelopedPyBullet- Real-time Physics Simulation LibraryKiCAD- Electronic/PCB Design SoftwareLLM/AI based model generationFreeCAD- CAD SoftwareThreeJS- Web-based 3D LibraryLibfive- Signed Distance Field Modeling libraryWorking with the software of your choiceRemember to first follow the gettingstarted instructionsCompatible softwareBlenderFusion360OnshapeBlenderDownload a release of the Blender Addon fromCodeToCADBlenderAddon.zipor from the latestreleaseNote for developers: instead of downloading a release, you can clone this repository, then importblender_addon.pyand set to CodeToCAD path in the addon to the root of this repository. Please watch this guide to get set up:Video GuideInstall the Blender Addon in the blender softwareImport your script using the file menu > import > CodeToCAD or the CodeToCAD menu in the sidebar.Note, you can also run CodeToCAD in Blender via cli:blender -- --codetocad $(pwd)/yourScript.pyorcodetocad yourScript.py blender /path/to/blender/executableSidebar PanelYou can use the side-panel to import CodeToCAD files or start a debugger server.Fusion 360To use CodeToCAD with Fusion 360, please install the Add-In. Please check out theREADMEfor more information.OnshapePlease refer to theOnshape READMEfor more information on how to setup an API key and connect to the Onshape Client.What's nextRun or browse theexamples!Join theDiscord Serverto receive updates and help from the community!For the developersWe welcome all contributors to the project, to get started with contributing check out ourContributing guidelinesAdditional ResourcesCodeToCAD docsCodeToCAD PyPIBlender API docsContributorsThank 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:GitHub SponsorsPatreon