meshright 0.1.0__tar.gz
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.
- meshright-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +20 -0
- meshright-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +13 -0
- meshright-0.1.0/.github/workflows/pypi.yml +39 -0
- meshright-0.1.0/.github/workflows/release.yml +76 -0
- meshright-0.1.0/.github/workflows/tests.yml +22 -0
- meshright-0.1.0/.gitignore +36 -0
- meshright-0.1.0/CODE_OF_CONDUCT.md +14 -0
- meshright-0.1.0/CONTRIBUTING.md +74 -0
- meshright-0.1.0/LICENSE +674 -0
- meshright-0.1.0/PKG-INFO +166 -0
- meshright-0.1.0/README.md +134 -0
- meshright-0.1.0/docs/demo.gif +0 -0
- meshright-0.1.0/docs/screenshot-cleanup.png +0 -0
- meshright-0.1.0/docs/screenshot-which-way-up.png +0 -0
- meshright-0.1.0/docs/screenshot.png +0 -0
- meshright-0.1.0/packaging/build.sh +21 -0
- meshright-0.1.0/packaging/launcher.py +8 -0
- meshright-0.1.0/pyproject.toml +53 -0
- meshright-0.1.0/src/meshright/__init__.py +3 -0
- meshright-0.1.0/src/meshright/__main__.py +5 -0
- meshright-0.1.0/src/meshright/actions.py +710 -0
- meshright-0.1.0/src/meshright/analysis.py +653 -0
- meshright-0.1.0/src/meshright/batch.py +159 -0
- meshright-0.1.0/src/meshright/bust.py +111 -0
- meshright-0.1.0/src/meshright/cli.py +141 -0
- meshright-0.1.0/src/meshright/colour.py +91 -0
- meshright-0.1.0/src/meshright/combine.py +91 -0
- meshright-0.1.0/src/meshright/cut.py +217 -0
- meshright-0.1.0/src/meshright/document.py +117 -0
- meshright-0.1.0/src/meshright/formats.py +73 -0
- meshright-0.1.0/src/meshright/intersections.py +131 -0
- meshright-0.1.0/src/meshright/merge.py +138 -0
- meshright-0.1.0/src/meshright/orient.py +211 -0
- meshright-0.1.0/src/meshright/orientation.py +114 -0
- meshright-0.1.0/src/meshright/pointcloud.py +97 -0
- meshright-0.1.0/src/meshright/project.py +97 -0
- meshright-0.1.0/src/meshright/quality.py +71 -0
- meshright-0.1.0/src/meshright/repair.py +691 -0
- meshright-0.1.0/src/meshright/samples.py +99 -0
- meshright-0.1.0/src/meshright/sculpt.py +79 -0
- meshright-0.1.0/src/meshright/server.py +634 -0
- meshright-0.1.0/src/meshright/settings.py +112 -0
- meshright-0.1.0/src/meshright/slicers.py +113 -0
- meshright-0.1.0/src/meshright/thickness.py +48 -0
- meshright-0.1.0/src/meshright/updates.py +54 -0
- meshright-0.1.0/src/meshright/web/app.js +2598 -0
- meshright-0.1.0/src/meshright/web/favicon.svg +1 -0
- meshright-0.1.0/src/meshright/web/index.html +515 -0
- meshright-0.1.0/src/meshright/web/style.css +717 -0
- meshright-0.1.0/src/meshright/web/vendor/three/LICENSE +21 -0
- meshright-0.1.0/src/meshright/web/vendor/three/addons/OrbitControls.js +1523 -0
- meshright-0.1.0/src/meshright/web/vendor/three/addons/STLLoader.js +411 -0
- meshright-0.1.0/src/meshright/web/vendor/three/addons/TransformControls.js +1608 -0
- meshright-0.1.0/src/meshright/web/vendor/three/three.module.min.js +6 -0
- meshright-0.1.0/tests/__init__.py +0 -0
- meshright-0.1.0/tests/conftest.py +47 -0
- meshright-0.1.0/tests/test_actions.py +121 -0
- meshright-0.1.0/tests/test_analysis.py +116 -0
- meshright-0.1.0/tests/test_batch.py +83 -0
- meshright-0.1.0/tests/test_bust.py +74 -0
- meshright-0.1.0/tests/test_colour.py +78 -0
- meshright-0.1.0/tests/test_combine.py +77 -0
- meshright-0.1.0/tests/test_cut.py +90 -0
- meshright-0.1.0/tests/test_document.py +52 -0
- meshright-0.1.0/tests/test_formats.py +88 -0
- meshright-0.1.0/tests/test_merge.py +71 -0
- meshright-0.1.0/tests/test_orient.py +122 -0
- meshright-0.1.0/tests/test_orientation.py +51 -0
- meshright-0.1.0/tests/test_part.py +59 -0
- meshright-0.1.0/tests/test_pointcloud.py +60 -0
- meshright-0.1.0/tests/test_project.py +55 -0
- meshright-0.1.0/tests/test_quality.py +34 -0
- meshright-0.1.0/tests/test_repair.py +278 -0
- meshright-0.1.0/tests/test_review_fixes.py +161 -0
- meshright-0.1.0/tests/test_sculpt.py +58 -0
- meshright-0.1.0/tests/test_server.py +173 -0
- meshright-0.1.0/tests/test_settings.py +73 -0
- meshright-0.1.0/tests/test_slicers.py +82 -0
- meshright-0.1.0/tests/test_thickness.py +45 -0
- meshright-0.1.0/tests/test_updates.py +35 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Something went wrong
|
|
3
|
+
about: MeshRight did something unexpected, or could not fix a model
|
|
4
|
+
labels: bug
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**What happened**
|
|
8
|
+
<!-- What did you do, and what did MeshRight do? -->
|
|
9
|
+
|
|
10
|
+
**What you expected**
|
|
11
|
+
|
|
12
|
+
**The report**
|
|
13
|
+
<!-- Paste the output of `meshright check yourfile.stl`, or a screenshot of the Problems list. -->
|
|
14
|
+
|
|
15
|
+
**The model**
|
|
16
|
+
<!-- If you can share it, attach the file (zip it if needed). Only share models you have the right to share, and nothing with personal data. Otherwise say where it came from: which scanner, app or website. -->
|
|
17
|
+
|
|
18
|
+
**Your computer**
|
|
19
|
+
- Windows / macOS / Linux:
|
|
20
|
+
- MeshRight version (shown by `meshright --version`):
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Idea or request
|
|
3
|
+
about: Something MeshRight should do, or do more simply
|
|
4
|
+
labels: idea
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**What are you trying to do?**
|
|
8
|
+
<!-- The job, not the button: for example "print a bust I scanned at the museum". -->
|
|
9
|
+
|
|
10
|
+
**What gets in the way today?**
|
|
11
|
+
|
|
12
|
+
**How would you like it to work?**
|
|
13
|
+
<!-- Keep it beginner friendly: what would someone who has never used a mesh tool click? -->
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
# When a release is published on GitHub, build MeshRight and upload it to
|
|
4
|
+
# PyPI, so anyone can install it with `pip install meshright`.
|
|
5
|
+
# Uses PyPI "trusted publishing": no password or token is stored anywhere.
|
|
6
|
+
# One-time setup on pypi.org: add a (pending) trusted publisher with owner
|
|
7
|
+
# Huzy85, repository MeshRight, workflow pypi.yml and environment pypi.
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
release:
|
|
11
|
+
types: [published]
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
21
|
+
- run: python -m pip install build
|
|
22
|
+
- run: python -m build
|
|
23
|
+
- uses: actions/upload-artifact@v4
|
|
24
|
+
with:
|
|
25
|
+
name: python-package
|
|
26
|
+
path: dist/
|
|
27
|
+
|
|
28
|
+
publish:
|
|
29
|
+
needs: build
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
environment: pypi
|
|
32
|
+
permissions:
|
|
33
|
+
id-token: write
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/download-artifact@v4
|
|
36
|
+
with:
|
|
37
|
+
name: python-package
|
|
38
|
+
path: dist/
|
|
39
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
name: Build apps
|
|
2
|
+
|
|
3
|
+
# Builds the one-file MeshRight app for Windows, macOS and Linux.
|
|
4
|
+
# Run it by hand from the Actions tab, or push a tag like v0.2.0 to also
|
|
5
|
+
# publish a GitHub release with the three files attached.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
push:
|
|
10
|
+
tags: ["v*"]
|
|
11
|
+
# Branch pushes build only when the packaging itself changes.
|
|
12
|
+
# (GitHub ignores path filters for tag pushes, so tags always build.)
|
|
13
|
+
branches: ["**"]
|
|
14
|
+
paths: ["packaging/**", ".github/workflows/release.yml"]
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: write
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
build:
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
include:
|
|
25
|
+
- os: windows-latest
|
|
26
|
+
file: MeshRight.exe
|
|
27
|
+
asset: MeshRight-windows.exe
|
|
28
|
+
- os: macos-latest
|
|
29
|
+
file: MeshRight
|
|
30
|
+
asset: MeshRight-macos
|
|
31
|
+
- os: ubuntu-22.04
|
|
32
|
+
file: MeshRight
|
|
33
|
+
asset: MeshRight-linux
|
|
34
|
+
runs-on: ${{ matrix.os }}
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
- uses: actions/setup-python@v5
|
|
38
|
+
with:
|
|
39
|
+
python-version: "3.12"
|
|
40
|
+
- name: Install
|
|
41
|
+
run: pip install ".[dev]" pyinstaller
|
|
42
|
+
- name: Test
|
|
43
|
+
run: pytest -q
|
|
44
|
+
- name: Build
|
|
45
|
+
shell: bash
|
|
46
|
+
run: packaging/build.sh
|
|
47
|
+
- name: Smoke test the app
|
|
48
|
+
shell: bash
|
|
49
|
+
run: |
|
|
50
|
+
./dist/${{ matrix.file }} serve --no-browser --port 8765 &
|
|
51
|
+
for i in $(seq 1 30); do
|
|
52
|
+
curl -sf http://127.0.0.1:8765/api/health && break
|
|
53
|
+
sleep 2
|
|
54
|
+
done
|
|
55
|
+
curl -sf http://127.0.0.1:8765/api/health
|
|
56
|
+
- name: Name the file
|
|
57
|
+
shell: bash
|
|
58
|
+
run: mv "dist/${{ matrix.file }}" "dist/${{ matrix.asset }}"
|
|
59
|
+
- uses: actions/upload-artifact@v4
|
|
60
|
+
with:
|
|
61
|
+
name: ${{ matrix.asset }}
|
|
62
|
+
path: dist/${{ matrix.asset }}
|
|
63
|
+
|
|
64
|
+
release:
|
|
65
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
66
|
+
needs: build
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/download-artifact@v4
|
|
70
|
+
with:
|
|
71
|
+
path: dist
|
|
72
|
+
merge-multiple: true
|
|
73
|
+
- uses: softprops/action-gh-release@v2
|
|
74
|
+
with:
|
|
75
|
+
files: dist/*
|
|
76
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.10", "3.12"]
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python-version }}
|
|
21
|
+
- run: pip install -e ".[dev]"
|
|
22
|
+
- run: pytest -q
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
build/
|
|
6
|
+
dist/
|
|
7
|
+
.venv/
|
|
8
|
+
venv/
|
|
9
|
+
.pytest_cache/
|
|
10
|
+
.coverage
|
|
11
|
+
htmlcov/
|
|
12
|
+
|
|
13
|
+
# Secrets and local settings: never commit these
|
|
14
|
+
.env
|
|
15
|
+
.env.*
|
|
16
|
+
!.env.example
|
|
17
|
+
*.pem
|
|
18
|
+
*.key
|
|
19
|
+
secrets/
|
|
20
|
+
credentials*.json
|
|
21
|
+
|
|
22
|
+
# Editors and OS
|
|
23
|
+
.vscode/
|
|
24
|
+
.idea/
|
|
25
|
+
.DS_Store
|
|
26
|
+
Thumbs.db
|
|
27
|
+
|
|
28
|
+
# Personal test models: keep real scans out of the repo
|
|
29
|
+
/scans/
|
|
30
|
+
/models/
|
|
31
|
+
*.local.stl
|
|
32
|
+
*.local.obj
|
|
33
|
+
*.local.ply
|
|
34
|
+
|
|
35
|
+
# Packaged app builds
|
|
36
|
+
*.spec
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Code of conduct
|
|
2
|
+
|
|
3
|
+
MeshRight is for everyone, from first-time printers to experts. Be kind, be
|
|
4
|
+
patient with beginners, and assume good intent.
|
|
5
|
+
|
|
6
|
+
- Explain things plainly; nobody is expected to know the jargon.
|
|
7
|
+
- Critique ideas and code, never people.
|
|
8
|
+
- No harassment, insults or discrimination of any kind.
|
|
9
|
+
- Do not share other people's personal data, or models you do not have the
|
|
10
|
+
right to share.
|
|
11
|
+
|
|
12
|
+
We follow the [Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
|
|
13
|
+
Maintainers may remove comments or contributions that break these rules.
|
|
14
|
+
Report problems privately to the maintainers through GitHub.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributing to MeshRight
|
|
2
|
+
|
|
3
|
+
Thanks for helping. MeshRight is meant to be a community project, so all kinds
|
|
4
|
+
of help count: bug reports, example meshes that break things, documentation,
|
|
5
|
+
design ideas and code.
|
|
6
|
+
|
|
7
|
+
## Reporting a problem
|
|
8
|
+
|
|
9
|
+
Open an issue and include:
|
|
10
|
+
|
|
11
|
+
- what you did and what you expected to happen
|
|
12
|
+
- the output of `meshright check yourfile.stl`
|
|
13
|
+
- the file, if you can share it, or a description of where it came from
|
|
14
|
+
(which scanner, which app exported it)
|
|
15
|
+
|
|
16
|
+
Please only attach models you have the right to share, and never attach
|
|
17
|
+
anything containing personal data.
|
|
18
|
+
|
|
19
|
+
## Setting up for development
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git clone https://github.com/Huzy85/MeshRight.git
|
|
23
|
+
cd MeshRight
|
|
24
|
+
python -m venv .venv
|
|
25
|
+
source .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
26
|
+
pip install -e ".[dev]"
|
|
27
|
+
pytest
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Run the app with `meshright` and open http://127.0.0.1:8765.
|
|
31
|
+
|
|
32
|
+
To build the one-file app for your own computer:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install pyinstaller
|
|
36
|
+
packaging/build.sh # the app appears in dist/
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## How the code is laid out
|
|
40
|
+
|
|
41
|
+
| Path | What it is |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `src/meshright/analysis.py` | Loads meshes, finds problems, computes the score |
|
|
44
|
+
| `src/meshright/formats.py` | Extra file readers and unit/orientation fixes per format |
|
|
45
|
+
| `src/meshright/actions.py` | Every change MeshRight can make, as named actions with checked inputs |
|
|
46
|
+
| `src/meshright/document.py` | An open model and its undo history |
|
|
47
|
+
| `src/meshright/server.py` | Local web server and API, including protection against other websites |
|
|
48
|
+
| `src/meshright/cli.py` | The `meshright` command |
|
|
49
|
+
| `src/meshright/web/` | Browser app (plain HTML, CSS and JavaScript, no build step) |
|
|
50
|
+
| `src/meshright/web/vendor/` | Bundled three.js, so the app works offline |
|
|
51
|
+
| `tests/` | Tests. Test meshes are generated in code |
|
|
52
|
+
|
|
53
|
+
## Guidelines
|
|
54
|
+
|
|
55
|
+
- **Beginners first.** Every message a user sees should make sense to someone
|
|
56
|
+
who has never heard the word "manifold". Say what is wrong and why it matters
|
|
57
|
+
for printing.
|
|
58
|
+
- **No settings unless they are unavoidable.** Good defaults beat options.
|
|
59
|
+
- **Local and offline.** Nothing may send a user's files or data to a remote
|
|
60
|
+
service. Optional online features must be opt-in and bring-your-own-key.
|
|
61
|
+
- **Never commit secrets or personal data.** No API keys, tokens, passwords,
|
|
62
|
+
email addresses or personal file paths in code, tests, issues or commits.
|
|
63
|
+
Keep local settings in a `.env` file; it is ignored by git.
|
|
64
|
+
- **Every change is an action.** New tools go in `actions.py` with a clear
|
|
65
|
+
title, description and checked inputs, and return a plain-English receipt.
|
|
66
|
+
The buttons, batch mode and the optional AI assistant all use this list.
|
|
67
|
+
- **Add a test** for every new check or repair. Build the test mesh in code
|
|
68
|
+
(see `tests/conftest.py`) rather than adding binary files.
|
|
69
|
+
- **Keep pull requests small** and focused on one thing.
|
|
70
|
+
|
|
71
|
+
## Licence
|
|
72
|
+
|
|
73
|
+
By contributing you agree that your work is released under the
|
|
74
|
+
[GNU GPL v3](LICENSE), the same licence as the rest of the project.
|