Skip to content

quasipedia/bd_init

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BD Init - Get designing in seconds!

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

Dependencies

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:

  • bash
  • curl
  • cut
  • jq
  • readlink
  • sed
  • envsubst

Installation

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...

Option one

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.sh

Option two

If 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"

Usage

The format for running the script is:

./bd_init.sh <project-name> <project-type> <preferred-viewer>

where:

  • project-name will 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-type is one of bare, app, package or lib (see uv documentation for details on the differences between them)
  • preferred-viewer is one of ocp or yacv.

Examples:

bd_init test bare yacv
bd_init simple-wedge app yacv
bd_init marble-run package ocp
bd_init lego-parts lib yacv

Tips

  • This script saves all the output of the commands it runs in the creation_log.txt file 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 the pyproject.toml and uv.lock files). As an additional precaution, the file is added by default to .gitignore, so it won't get committed by mistake.
  • bd_init will also create a nuke.sh script 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).

Features

The script (unchecked features are still not operational) does:

  • notify if newer versions of bd_script are available
  • prepare an isolated .venv for the project,
  • install all dependencies (including --dev ones)
  • configure the varius dev tools (e.g.: ruff)
  • create a relevant .gitignore file
  • install nuke.sh, a script to completely purge the project from the system
  • creates a custom README.md file (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.

Contributing

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.

Lincense

© 2025. This work is openly licensed via CC0

About

An init script based on `uv` to get you going with `build123d`

Resources

License

Stars

Watchers

Forks

Packages

No packages published