Links
Usage:
Code:
Community:
Usage
This library will generate 3 parts to use with a rounded tube (or whatever circular, like glasses, pots, ...):
- A bottom cap, to be glued on the tube
- A top cap, to be glued on the tube
- A screw, for the lid
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:
dependencies= [
#...
"bd_tube_boxes @ git+https://gitlab.com/experimentslabs/3d/bd_tube_boxes.git",
]
Generating boxes
from build123d import export_step
from src.bd_tube_boxes.rounded_canister import RoundedCanister
box = RoundedCanister(tube_ext_diameter=50, tube_thickness=1.5)
export_step(box.bottom(), 'box_bottom')
export_step(box.top(), 'box_top')
export_step(box.screw(), 'box_screw')
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
# One specific file
python some_part.py
# Predefined task
poe dev_rounded
# Or add a watcher on all .py files and executes "some_file.py" on changes
find . -type f -name "*.py" | entr -s "clear && python some_file.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.
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.