Build123d - parts
build123d library to generate various models.Links
Code:
Community:
Usage
Setup
There is no pypi module for now; use the git repository. If you need a specific reference, append it to the repository
url with @<ref>.
This library don't use the pypi version of build123d, as we rely on unreleased features. Check pyproject.toml to see the git reference.
Pip:
Or, with requirements.txt:
and in a pyproject.yml:
Then:
For more parameters, check the API documentation.
Contributing
Bug reports and pull requests are welcome on the issue tracker at GitLab. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
Setup
First of all, clone the repository.
The following steps creates a Python virtual environment to develop this project. If you already have an environment for Build123d projects, it may be enough.
Let's just say the project successfully builds with the Build123d version
specified in requirements.txt.
- Create a Python environment:
- Activate the env:
- Install dependencies:
Now, code :)
There is a file, dev.py which has a lot of boilerplate to help in developing specific parts of the library. Feel free
to edit it if needed. It relies on show_object and other methods from ocp_vscode, so either edit the code in VSCodium
with the right plugin, or start the viewer server manually (check the section right after).
OCP VSCode without VSCodium
To use ocp_vscode to develop the parts, but without VSCodium:
- Manually start the server
- Manually render the files or use a watcher
python some_part.py # One specific file
# Or add a watcher on all .py files and executes "dev.py" on changes
find . -type f -name "*.py" | entr -s "clear && python dev.py"
Feel free to change dev.py during the development, and commit your pertinent changes
Tools
Use diff3d (included in the .[tools] dependencies) to compare generated models:
Linting and formatting
To check all the code:
To fix what is fixable automatically:
Checking licenses
To help ensuring the project has a valid license, run licensecheck; it will
compare the license with the ones of the dependencies.
You only have to run it when dependencies changes.
Testing
Run unit tests with:
Documentation
Documentation is generated in CI. To generate it locally:
# Copies markdown files and generate pictures; there is no need to run it
# every time.
scripts/prepare_documentation.sh
# Serve documentation locally
poe docs-serve
# Open your browser at the link given by the server.
Notes about scripts/prepare_documentation.sh:
prepare_documentation.shwill replace thergb(17,17,17)color with CSS'scurrentcolorin all SVGs to adapt generated files to both light and dark modes- To create a note compatible in both mkdoc and Gitlab, create one line notes with this format:
!!! note "The note. It" will be nicely displayed for people browsing from Gitlab, and will be converted to admonitions in mkdocs
License
This library is available as open source under the terms of the GPL v3 License.
Code of Conduct
Everyone interacting in this project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.