This is a script to automate the initialisation of Build123d projects, a CAD code package.
With it, you will be able to get going with your CAD design in about 20 seconds:
B123-in-under-30-seconds.mp4
The script core functionality is provided by uv, so you must have uv installed on your system.
Additionally, if you are going to build your package (for example because it is a library) you optionally may install uv_build for a faster, more integrated building experience, but this is not necessary.
The other dependencies of the script are typically installed by default in any modern GNU/Linux distribution, some of them are:
bashcurlcutjqreadlinksedenvsubst
The recommended way to install the script is to clone the repository somewhere fitting...
~ ❯❯❯ cd code
~/code ❯❯❯ git clone [email protected]:quasipedia/bd_init.git...and either...
If all your CAD projects share the same folder, create a symlink to bd_init.sh in that directory.
~/cad_projects ❯❯❯ ln -s ~/code/bd_init/bd_init.shIf you need or prefer to be able to invoke the script from anywhere in your system, append the cloned directory to your system $PATH by adding to your shell initialisation script (e.g.: ~/.bashrc or ~/.zshrc) the following line:
export PATH="~/code/bd_init:$PATH"The format for running the script is:
./bd_init.sh <project-name> <project-type> <preferred-viewer>where:
project-namewill be the name of the project AND of the directory (created where the script is currently running) containing all the code and the virtual environment,project-typeis one ofbare,app,packageorlib(see uv documentation for details on the differences between them)preferred-vieweris one ofocporyacv.
Examples:
bd_init test bare yacv
bd_init simple-wedge app yacv
bd_init marble-run package ocp
bd_init lego-parts lib yacv
- This script saves all the output of the commands it runs in the
creation_log.txtfile in the root of the newly created project. The file is meant for debugging any problem one may encounter with the script; after the project creation it can be safely deleted (all the info needed for replicability of the project are already in thepyproject.tomlanduv.lockfiles). As an additional precaution, the file is added by default to.gitignore, so it won't get committed by mistake. bd_initwill also create anuke.shscript in the project folder, which automates the process of removing the entire project, including configuration options that IPython keeps outside of the project folder (you will be prompted for confirmation beforheands).
The script (unchecked features are still not operational) does:
- notify if newer versions of
bd_scriptare available - prepare an isolated
.venvfor the project, - install all dependencies (including
--devones) - configure the varius dev tools (e.g.:
ruff) - create a relevant
.gitignorefile - install
nuke.sh, a script to completely purge the project from the system - creates a custom
README.mdfile (generic but informative) - creates a minimal working example tailored to your chosen type of project and CAD viewer
- EMPTY
- PART
- ASSEMBLY
- LIBRARY (coming soon)
Explicitly out-of-scope:
- IDE or text editor configuration.
You are more than welcome to open an issue or a pull-requests if you find a bug, want to add a feature, improve on the existing functionality or if you simply have some feedback that you would like to share.
© 2025. This work is openly licensed via CC0