part-grimoire 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- part_grimoire-0.3.0.dist-info/METADATA +209 -0
- part_grimoire-0.3.0.dist-info/RECORD +21 -0
- part_grimoire-0.3.0.dist-info/WHEEL +5 -0
- part_grimoire-0.3.0.dist-info/entry_points.txt +2 -0
- part_grimoire-0.3.0.dist-info/licenses/LICENSE +21 -0
- part_grimoire-0.3.0.dist-info/top_level.txt +1 -0
- partgrimoire/__init__.py +5 -0
- partgrimoire/__main__.py +3 -0
- partgrimoire/cast.py +409 -0
- partgrimoire/cli.py +244 -0
- partgrimoire/exports.py +108 -0
- partgrimoire/familiar.py +209 -0
- partgrimoire/glyphs.py +28 -0
- partgrimoire/hardware.py +91 -0
- partgrimoire/page.py +79 -0
- partgrimoire/reagents.py +98 -0
- partgrimoire/reference.py +131 -0
- partgrimoire/ritual.py +156 -0
- partgrimoire/rubric.py +500 -0
- partgrimoire/scrying.py +303 -0
- partgrimoire/visions.py +149 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: part-grimoire
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Cast a 3D-printable part from a config file and Python CAD code into STL, STEP, assemblies, exploded views, DXF outlines, Bambu Studio print files, a BOM, and docs.
|
|
5
|
+
Author: Spikeon Studio
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Spikeon-Studio/part-grimoire
|
|
8
|
+
Project-URL: Documentation, https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/index.md
|
|
9
|
+
Project-URL: Issues, https://github.com/Spikeon-Studio/part-grimoire/issues
|
|
10
|
+
Keywords: cad,3d-printing,step,stl,bom,exploded-view,bambu-studio,badcad
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Manufacturing
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: badcad-occt[occt,svg]<0.3,>=0.2
|
|
23
|
+
Requires-Dist: numpy>=2.0
|
|
24
|
+
Requires-Dist: pillow>=11
|
|
25
|
+
Requires-Dist: moderngl>=5.12
|
|
26
|
+
Requires-Dist: matplotlib>=3.9
|
|
27
|
+
Requires-Dist: ezdxf>=1.3
|
|
28
|
+
Provides-Extra: text
|
|
29
|
+
Requires-Dist: badcad-occt[text]<0.3,>=0.2; extra == "text"
|
|
30
|
+
Provides-Extra: test
|
|
31
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
<p align="center"><img src="https://raw.githubusercontent.com/Spikeon-Studio/part-grimoire/main/docs/assets/banner.png" alt="part-grimoire: a terminal tool to materialize CAD from code grimoires" width="100%"></p>
|
|
35
|
+
|
|
36
|
+
# part-grimoire
|
|
37
|
+
|
|
38
|
+
[](https://github.com/Spikeon-Studio/part-grimoire/actions/workflows/test.yml)
|
|
39
|
+
[](https://pypi.org/project/part-grimoire/)
|
|
40
|
+
[](https://github.com/Spikeon-Studio/part-grimoire/blob/main/LICENSE)
|
|
41
|
+
|
|
42
|
+
part-grimoire turns a part, written as a config file and Python CAD code, into a folder with everything to make it. It operates in the terminal, on your own computer, one stage after the other.
|
|
43
|
+
|
|
44
|
+
You write a **chapter**: a **rubric** (`rubric.toml`) and an **incantation** (a [badcad](https://github.com/spikeon/badcad) Python file). Then you **cast** it. The cast writes a **page** for each aspect (variant) of the part. It seals each page into a **spell** (a zip file). A page has:
|
|
45
|
+
|
|
46
|
+
- an STL and a STEP file for each **talisman** (printed piece)
|
|
47
|
+
- a **glyph** (a DXF outline) of each talisman
|
|
48
|
+
- the **bound form** (the assembled part) as STL, 3MF, and STEP, with one named, coloured solid for each item
|
|
49
|
+
- the **sigil** (thumbnail) and an **illumination** (picture) of each talisman
|
|
50
|
+
- an exploded view of each **rite** (assembly step), and **the unveiling** (an exploded view of all the rites)
|
|
51
|
+
- the **manifestation**: a Bambu Studio print project and a sliced plate, with the print time and the filament weight
|
|
52
|
+
- the **reagents** (the bill of materials) as CSV, JSON, and Markdown
|
|
53
|
+
- the page text (a README) and the **colophon** (the build record)
|
|
54
|
+
|
|
55
|
+
The [glossary](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/glossary.md) gives the plain meaning of each term. part-grimoire is a terminal version of the model build pipeline of ExoWorks.
|
|
56
|
+
|
|
57
|
+
## Install
|
|
58
|
+
|
|
59
|
+
### With pip
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install part-grimoire
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
pip installs part-grimoire and its Python packages. It does not install the system libraries or the familiar (Bambu Studio). Without the familiar, use `cast --no-manifest`. `part-grimoire augur` shows what is missing.
|
|
66
|
+
|
|
67
|
+
### With the installer
|
|
68
|
+
|
|
69
|
+
The installer installs everything, the familiar included:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
git clone https://github.com/Spikeon-Studio/part-grimoire.git
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
cd part-grimoire && ./install.sh
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The installer installs:
|
|
80
|
+
|
|
81
|
+
1. The system packages: Python, git, the OpenGL and EGL libraries, Xvfb, and the cairo headers. It uses `apt`, `dnf`, `pacman`, or `zypper`, and `sudo` prompts you for your password.
|
|
82
|
+
2. A Python environment in `~/.local/share/part-grimoire/venv` with badcad, build123d, manifold3d, OCP, numpy, scipy, shapely, Pillow, moderngl, matplotlib, ezdxf, and pycairo.
|
|
83
|
+
3. The `part-grimoire` command in `~/.local/bin`.
|
|
84
|
+
4. The familiar (Bambu Studio): the Docker image `ghcr.io/spikeon/bambu-studio-mcp:latest` if Docker is on the computer, else `com.bambulab.BambuStudio` from Flathub.
|
|
85
|
+
|
|
86
|
+
Then it starts `part-grimoire augur`, which checks each dependency.
|
|
87
|
+
|
|
88
|
+
| Installer option | Effect |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| `--familiar docker` | Use the Docker image of Bambu Studio. Install Docker if it is missing. |
|
|
91
|
+
| `--familiar flatpak` | Use Bambu Studio from Flathub. Install Flatpak if it is missing. |
|
|
92
|
+
| `--familiar skip` | Do not install Bambu Studio. The casts make no manifestation. |
|
|
93
|
+
| `--no-system` | Do not install system packages. |
|
|
94
|
+
| `--dev` | Make an editable install with the test tools. |
|
|
95
|
+
| `--uninstall` | Remove the environment, the command link, and the settings. |
|
|
96
|
+
|
|
97
|
+
## Quick start
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
part-grimoire inscribe my-box
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
part-grimoire cast my-box
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The page is in `my-box/pages/my-box/`, and the spell is `my-box/pages/my-box.spell.zip`. To find and store a good camera for each picture:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
part-grimoire divine my-box
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Commands
|
|
114
|
+
|
|
115
|
+
| Command | Effect |
|
|
116
|
+
| --- | --- |
|
|
117
|
+
| `part-grimoire cast [chapter]` | Cast the spell: make the page and the spell of each aspect. |
|
|
118
|
+
| `part-grimoire divine [chapter]` | Find the cameras of the views and store them in `visions.toml`. `--jev` lets Jev find. |
|
|
119
|
+
| `part-grimoire scry [chapter]` | Read the chapter. Show the talismans, the rites, and the reagent cost. Write nothing. |
|
|
120
|
+
| `part-grimoire inscribe <folder>` | Make a chapter with an example part. |
|
|
121
|
+
| `part-grimoire augur` | Check that the computer has all the dependencies. |
|
|
122
|
+
| `part-grimoire lore <machine\|process\|filament>` | List the Bambu Studio profiles. |
|
|
123
|
+
|
|
124
|
+
The [command reference](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/cli.md) gives all the options.
|
|
125
|
+
|
|
126
|
+
## A chapter
|
|
127
|
+
|
|
128
|
+
`rubric.toml`:
|
|
129
|
+
|
|
130
|
+
```toml
|
|
131
|
+
[chapter]
|
|
132
|
+
name = "cable-clip"
|
|
133
|
+
title = "Cable Clip"
|
|
134
|
+
version = "2.1"
|
|
135
|
+
incantation = "clip.py"
|
|
136
|
+
|
|
137
|
+
[aspects]
|
|
138
|
+
cable = [4, 6, 8]
|
|
139
|
+
|
|
140
|
+
[tinctures]
|
|
141
|
+
latch = "#d2691e"
|
|
142
|
+
|
|
143
|
+
[reagents."M3x12 screw"]
|
|
144
|
+
kind = "screw"
|
|
145
|
+
d = 3
|
|
146
|
+
length = 12
|
|
147
|
+
price = 7.49
|
|
148
|
+
pack = 100
|
|
149
|
+
|
|
150
|
+
[rites.latch]
|
|
151
|
+
title = "Attach the latch"
|
|
152
|
+
text = "Put the latch on the base. Install the screw."
|
|
153
|
+
camera = [-35, 15]
|
|
154
|
+
|
|
155
|
+
[manifestation]
|
|
156
|
+
printer = "Bambu Lab P1S 0.4 nozzle"
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`clip.py`:
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
from partgrimoire import Ritual
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def talismans(cable):
|
|
166
|
+
return {"base": base(), "latch": latch(cable)}
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def ritual(talismans, cable):
|
|
170
|
+
r = Ritual()
|
|
171
|
+
r.rite("latch")
|
|
172
|
+
r.talisman("base", talismans["base"])
|
|
173
|
+
r.talisman("latch", talismans["latch"], rite="latch", explode=0.8)
|
|
174
|
+
r.reagent("M3x12 screw", at=(-9, 0, 6 + cable + 4.8), axis=(0, 0, 1), rite="latch", explode=2.0)
|
|
175
|
+
return r
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
The full example is in [`examples/cable-clip`](https://github.com/Spikeon-Studio/part-grimoire/tree/main/examples/cable-clip).
|
|
179
|
+
|
|
180
|
+
## Cameras
|
|
181
|
+
|
|
182
|
+
Each picture can store its own camera (`camera`, `zoom`, `center`) in the rubric. `part-grimoire divine` finds cameras that show the items best, and stores them in `visions.toml`. With `--jev`, the Jev decision model finds from the best cameras. Jev is optional, and a stored camera always wins. See [Scrying and cameras](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/scrying.md).
|
|
183
|
+
|
|
184
|
+
## Documentation
|
|
185
|
+
|
|
186
|
+
| Page | Contents |
|
|
187
|
+
| --- | --- |
|
|
188
|
+
| [Get started](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/getting-started.md) | Install, inscribe, scry, cast, and divine |
|
|
189
|
+
| [The incantation](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/incantation.md) | `talismans()`, `ritual()`, and the `Ritual` methods |
|
|
190
|
+
| [Scrying and cameras](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/scrying.md) | The pictures, the stored cameras, `divine`, and Jev |
|
|
191
|
+
| [Reagents](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/reagents.md) | Hardware items, prices, and the reagent list |
|
|
192
|
+
| [The familiar](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/familiar.md) | Bambu Studio: backends, profiles, and print settings |
|
|
193
|
+
| [The page](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/page.md) | The outputs, the glyphs, the colophon, and the seal |
|
|
194
|
+
| [Rubric reference](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/rubric.md) | Each table and key, with its type and default |
|
|
195
|
+
| [Command reference](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/cli.md) | All commands and options |
|
|
196
|
+
| [Glossary](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/glossary.md) | The grimoire terms |
|
|
197
|
+
| [Troubleshooting](https://github.com/Spikeon-Studio/part-grimoire/blob/main/docs/troubleshooting.md) | Errors and their causes |
|
|
198
|
+
|
|
199
|
+
## Tests
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
./install.sh --dev
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
~/.local/share/part-grimoire/venv/bin/python -m pytest
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
The tests use only the fixture chapter in `tests/fixtures`. They do not start the familiar or Jev. GitHub Actions does the tests on Python 3.12 and 3.14 for each push to `main` and each pull request.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
part_grimoire-0.3.0.dist-info/licenses/LICENSE,sha256=C6GP3debqn-bBZBJnDzyp19imZxjGGqbLZz3W6ItQYY,1071
|
|
2
|
+
partgrimoire/__init__.py,sha256=1pr4Zt13evHP20Pxe3oVg1iWpnYljYYSFSEH6eGlvnM,101
|
|
3
|
+
partgrimoire/__main__.py,sha256=bYt9eEaoRQWdejEHFD8REx9jxVEdZptECFsV7F49Ink,30
|
|
4
|
+
partgrimoire/cast.py,sha256=EwUp3YdwHz2SW8d5uF04x6ld5Pkh7K8__hNRGPuCr4g,18127
|
|
5
|
+
partgrimoire/cli.py,sha256=rQznH8RBFM5KbcjvttSVQfQZnUOhJTRI9oFxMLZXFLs,10215
|
|
6
|
+
partgrimoire/exports.py,sha256=l4G43aE8f-4vbzdG1ngCr_A-NJD3vX-A-3QsB84GLik,3897
|
|
7
|
+
partgrimoire/familiar.py,sha256=OY1CJecHZeol9M8VZNpPpDzpfR7P2gF8aI8ZPa-w5TU,9756
|
|
8
|
+
partgrimoire/glyphs.py,sha256=7BeBbWi36sKN6lsMOpk5Z1muiY3nAnea_fptCvW4qpM,821
|
|
9
|
+
partgrimoire/hardware.py,sha256=YIiPilqXNviYy0-vi-7pbgJ2FBLPcWomuCwaE_qcKH0,2395
|
|
10
|
+
partgrimoire/page.py,sha256=C1ZJmOykrJfzN-knapDZ_eeKAppcffb7Hhj70uVAhoI,3886
|
|
11
|
+
partgrimoire/reagents.py,sha256=X20OO5WLm_ekNjTIXco2DtBpmWQx7ZbI5bUd1PohAtQ,3523
|
|
12
|
+
partgrimoire/reference.py,sha256=t6d_jxR_M9rkwgjoxfqitOKqAZ_isGIwfmn_asDcBNY,6685
|
|
13
|
+
partgrimoire/ritual.py,sha256=wCz8ZFvm5ByeUdF5guTDJ4xC-tR6u3DHIU3Yhin1oNg,5212
|
|
14
|
+
partgrimoire/rubric.py,sha256=Ec0gde_APy84VBtrQlXkEif_AyA1xyY_d7-659tPZdM,21849
|
|
15
|
+
partgrimoire/scrying.py,sha256=GTEUS0-Ska7lHggPNBdiJeKeiLpoXgrZ5cu-Q2Hqfk8,11629
|
|
16
|
+
partgrimoire/visions.py,sha256=pD0psiOZcL50Lh67Z227ZOwU9fKdnRbNIVGJMH4EeHU,6038
|
|
17
|
+
part_grimoire-0.3.0.dist-info/METADATA,sha256=UTwe6Izk-7d5FMiYQrmsfpelK6oolRK72q7zHbNOkWg,9289
|
|
18
|
+
part_grimoire-0.3.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
19
|
+
part_grimoire-0.3.0.dist-info/entry_points.txt,sha256=HMi4DMu2hS88-BmWSBpXZX-IihNW0a3mx2Z8SM6QIfQ,56
|
|
20
|
+
part_grimoire-0.3.0.dist-info/top_level.txt,sha256=MXhL49HmxSW38q74_4tAxVaffgT-Zt2wCZXHxmj6Oyw,13
|
|
21
|
+
part_grimoire-0.3.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Spikeon Studio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
partgrimoire
|
partgrimoire/__init__.py
ADDED
partgrimoire/__main__.py
ADDED