Compare commits

..

1 Commits

Author SHA1 Message Date
Leni Aniva a6685e6779
feat: Add model name prefix to build path 2024-12-07 13:46:23 -08:00
4 changed files with 373 additions and 3519 deletions

View File

@ -1,7 +1,6 @@
# Cosplay
This is the design repository for NorCal Hakkero Factory No. 1, where we use
parametric CAD to make cosplay props.
This is the design repository for NorCal Hakkero Factory No. 1.
## Development
@ -16,12 +15,6 @@ and this should succeed
python3 -c "import nhf"
```
To visualize an object, create a file `visualize.py`, and run `cq-editor`:
``` sh
python3 -m cq_editor visualize.py
```
## Testing
Run all tests with

View File

@ -214,7 +214,7 @@ class Submodel:
def write_to(self, obj, path: str):
x = self._method(obj)
assert isinstance(x, Model), f"Unexpected type: {type(x)}"
x.build_all(path)
x.build_all(path, prefix=False)
@classmethod
def methods(cls, subject):
@ -271,11 +271,17 @@ class Model:
total += 1
return total
def build_all(self, output_dir: Union[Path, str] = "build", verbose=1):
def build_all(
self,
output_dir: Union[Path, str] = "build",
prefix: bool = True,
verbose=1):
"""
Build all targets in this model and write the results to file
"""
output_dir = Path(output_dir)
if prefix:
output_dir = output_dir / self.name
targets = Target.methods(self)
for t in targets.values():
file_name = t.file_name

3861
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -8,21 +8,13 @@ readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
cadquery = {git = "https://github.com/CadQuery/cadquery.git"}
#build123d = "^0.5.0"
numpy = ">=2,<3"
build123d = "^0.5.0"
numpy = "^1.26.4"
colorama = "^0.4.6"
# cadquery dependency
multimethod = "^1.12"
scipy = "^1.14.0"
typish = "^1.9.3"
[tool.poetry.group.dev.dependencies]
cq-editor = {git = "https://github.com/CadQuery/CQ-editor.git"}
pyqt5 = "^5.15.11"
logbook = "^1.8.0"
spyder = "^5"
pyqtgraph = "^0.13.7"
[build-system]
requires = ["poetry-core"]