doc: Add development documentation
This commit is contained in:
parent
52dbb64b80
commit
711e0b6af1
60
README.md
60
README.md
|
@ -10,65 +10,17 @@ engineering point of view.
|
||||||
|
|
||||||
Most cosplay schematics are created with Blender, CadQuery, and Inkscape.
|
Most cosplay schematics are created with Blender, CadQuery, and Inkscape.
|
||||||
|
|
||||||
## Development
|
## Build
|
||||||
|
|
||||||
Install `uv`, and then execute
|
To build the schematics for one set, install `uv`, and execute (for example, for
|
||||||
|
`yasaka_kanako`)
|
||||||
|
|
||||||
``` sh
|
``` sh
|
||||||
uv sync
|
uv sync
|
||||||
|
uv run python3 nhf.touhou.yasaka_kanako
|
||||||
```
|
```
|
||||||
|
|
||||||
To get a development environment, run
|
## Development
|
||||||
``` sh
|
|
||||||
uv venv
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, either follow the instruction to activate this venv, or install `direnv`
|
For developer instructions, see [development](./doc/development.md).
|
||||||
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`:
|
|
||||||
|
|
||||||
``` sh
|
|
||||||
CQ-editor visualize.py
|
|
||||||
```
|
|
||||||
|
|
||||||
### Folder Structure
|
|
||||||
|
|
||||||
- `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
|
|
||||||
``` sh
|
|
||||||
unittest-parallel
|
|
||||||
```
|
|
||||||
|
|
||||||
## 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
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
# Development
|
||||||
|
|
||||||
|
Install `uv`, and then execute
|
||||||
|
|
||||||
|
``` sh
|
||||||
|
uv sync
|
||||||
|
```
|
||||||
|
|
||||||
|
## Environment
|
||||||
|
|
||||||
|
To get a development environment, run
|
||||||
|
``` sh
|
||||||
|
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`:
|
||||||
|
|
||||||
|
``` sh
|
||||||
|
CQ-editor visualize.py
|
||||||
|
```
|
||||||
|
|
||||||
|
## Folder Structure
|
||||||
|
|
||||||
|
- `nhf/parts/`: Ready-made parts
|
||||||
|
- `nhf/$WORK/$CHARACTER`: Design for an individual character
|
||||||
|
|
||||||
|
For each individual character, the `__main__.py` script stores the overall build
|
||||||
|
entry point and the entry point for all unit tests. Do not put build scripts in
|
||||||
|
`__init__.py`
|
||||||
|
|
||||||
|
### Testing
|
||||||
|
|
||||||
|
Run all tests with
|
||||||
|
``` sh
|
||||||
|
unittest-parallel
|
||||||
|
```
|
||||||
|
|
||||||
|
## 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
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue