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 # Cosplay
This is the design repository for NorCal Hakkero Factory No. 1, where we use This is the design repository for NorCal Hakkero Factory No. 1.
parametric CAD to make cosplay props.
## Development ## Development
@ -16,12 +15,6 @@ and this should succeed
python3 -c "import nhf" 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 ## Testing
Run all tests with Run all tests with

View File

@ -214,7 +214,7 @@ class Submodel:
def write_to(self, obj, path: str): def write_to(self, obj, path: str):
x = self._method(obj) x = self._method(obj)
assert isinstance(x, Model), f"Unexpected type: {type(x)}" assert isinstance(x, Model), f"Unexpected type: {type(x)}"
x.build_all(path) x.build_all(path, prefix=False)
@classmethod @classmethod
def methods(cls, subject): def methods(cls, subject):
@ -271,11 +271,17 @@ class Model:
total += 1 total += 1
return total 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 Build all targets in this model and write the results to file
""" """
output_dir = Path(output_dir) output_dir = Path(output_dir)
if prefix:
output_dir = output_dir / self.name
targets = Target.methods(self) targets = Target.methods(self)
for t in targets.values(): for t in targets.values():
file_name = t.file_name 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] [tool.poetry.dependencies]
python = "^3.10" python = "^3.10"
cadquery = {git = "https://github.com/CadQuery/cadquery.git"} cadquery = {git = "https://github.com/CadQuery/cadquery.git"}
#build123d = "^0.5.0" build123d = "^0.5.0"
numpy = ">=2,<3" numpy = "^1.26.4"
colorama = "^0.4.6" colorama = "^0.4.6"
# cadquery dependency # cadquery dependency
multimethod = "^1.12" multimethod = "^1.12"
scipy = "^1.14.0" 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] [build-system]
requires = ["poetry-core"] requires = ["poetry-core"]