Compare commits

..

No commits in common. "4f48955c81a8a2e606eed95fa6806fb2e0462d43" and "2a405f916a83dbb3f5cd8eb8e03457eeeb4b6484" have entirely different histories.

4 changed files with 4040 additions and 2800 deletions

View File

@ -1,74 +1,34 @@
# 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, where we use
parametric CAD to make cosplay props. We design cosplay props based on an parametric CAD to make cosplay props.
engineering point of view.
> NorCal Hakkero Factory № 1 > NorCal Hakkero Factory № 1
>
> 北加国営八卦炉第一工場 > 北加国営八卦炉第一工場
Most cosplay schematics are created with Blender, CadQuery, and Inkscape.
## Development ## Development
Install `uv`, and then execute Most cosplay schematics are created with Blender, CadQuery, and Inkscape. To
enter into a CadQuery environment, install `poetry` and use
``` sh ```sh
uv sync poetry install
poetry shell
``` ```
and this should succeed
To get a development environment, run ```sh
``` sh python3 -c "import nhf"
uv venv
``` ```
Then, either follow the instruction to activate this venv, or install `direnv`
and create the file
``` sh
# .envrc
source .venv/bin/activate
```
Test the environment with `python3 -c "import nhf"`
To visualize an object, create a file `visualize.py`, and run `cq-editor`: To visualize an object, create a file `visualize.py`, and run `cq-editor`:
``` sh ``` sh
python3 -m cq_editor visualize.py python3 -m cq_editor visualize.py
``` ```
### Folder Structure ## Testing
- `nhf/parts/`: Ready-made parts
- `nhf/$WORK/$CHARACTER`: Design for an individual character
For each individual character, the `__init__.py` script stores the overall build
entry point and the entry point for all unit tests.
### Testing
Run all tests with Run all tests with
``` sh ``` sh
unittest-parallel python3 -m unittest
```
## Troubleshooting
### Wayland
If there is the error
```
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 3 (X_GetWindowAttributes)
Resource id in failed request: 0x3
Serial number of failed request: 28
Current serial number in output stream: 29
```
Export the environment variable
``` sh
export QT_QPA_PLATFORM=xcb
``` ```

4010
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +1,28 @@
[project] [tool.poetry]
name = "nhf" name = "nhf"
version = "0.1.0" version = "0.1.0"
description = "NorCal Hakkero Factory No. 1 Cosplay Designs" description = "NorCal Hakkero Factory No. 1 Cosplay Designs"
authors = [{ name = "Leni Aniva", email = "aniva@stanford.edu" }] authors = ["Leni Aniva <v@leni.sh>"]
requires-python = ">=3.10,<3.13"
readme = "README.md" readme = "README.md"
dependencies = [
"cadquery==2.5.2",
"numpy>=2,<3",
"colorama>=0.4.6,<0.5",
"multimethod~=1.12",
"scipy>=1.14.0,<2",
"typish>=1.9.3,<2",
]
[dependency-groups] [tool.poetry.dependencies]
dev = [ python = ">=3.10,<3.13"
"cq-editor", cadquery = "2.5.2"
"pyqt5>=5.15.11,<6", numpy = ">=2,<3"
"logbook>=1.8.0,<2", colorama = "^0.4.6"
"spyder>=5,<6",
"pyqtgraph>=0.13.7,<0.14",
"unittest-parallel>=1.7.4",
]
[tool.uv] # cadquery dependency
multimethod = "^1.12"
scipy = "^1.14.0"
typish = "^1.9.3"
[tool.uv.sources] [tool.poetry.group.dev.dependencies]
cq-editor = { git = "https://github.com/CadQuery/CQ-editor.git" } 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 = ["hatchling"] requires = ["poetry-core"]
build-backend = "hatchling.build" build-backend = "poetry.core.masonry.api"

2724
uv.lock

File diff suppressed because it is too large Load Diff