primlib 0.3.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.
- primlib-0.3.0/.gitignore +9 -0
- primlib-0.3.0/.gitlab-ci.yml +85 -0
- primlib-0.3.0/LICENSE +22 -0
- primlib-0.3.0/PKG-INFO +124 -0
- primlib-0.3.0/README.md +75 -0
- primlib-0.3.0/pyproject.toml +71 -0
- primlib-0.3.0/setup.cfg +4 -0
- primlib-0.3.0/src/primlib/__init__.py +6 -0
- primlib-0.3.0/src/primlib/_version.py +24 -0
- primlib-0.3.0/src/primlib/line_set.py +435 -0
- primlib-0.3.0/src/primlib/point_cloud.py +711 -0
- primlib-0.3.0/src/primlib/triangle_mesh.py +1910 -0
- primlib-0.3.0/src/primlib/utils.py +53 -0
- primlib-0.3.0/src/primlib/vertices.py +604 -0
- primlib-0.3.0/src/primlib/visualizer.py +179 -0
- primlib-0.3.0/src/primlib.egg-info/PKG-INFO +124 -0
- primlib-0.3.0/src/primlib.egg-info/SOURCES.txt +25 -0
- primlib-0.3.0/src/primlib.egg-info/dependency_links.txt +1 -0
- primlib-0.3.0/src/primlib.egg-info/requires.txt +16 -0
- primlib-0.3.0/src/primlib.egg-info/scm_file_list.json +21 -0
- primlib-0.3.0/src/primlib.egg-info/scm_version.json +8 -0
- primlib-0.3.0/src/primlib.egg-info/top_level.txt +1 -0
- primlib-0.3.0/tests/conftest.py +7 -0
- primlib-0.3.0/tests/test_line_set.py +153 -0
- primlib-0.3.0/tests/test_point_cloud.py +389 -0
- primlib-0.3.0/tests/test_triangle_mesh.py +1356 -0
- primlib-0.3.0/tests/test_vertices.py +370 -0
primlib-0.3.0/.gitignore
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- linting
|
|
3
|
+
- test
|
|
4
|
+
- coverage
|
|
5
|
+
- build
|
|
6
|
+
- publish
|
|
7
|
+
|
|
8
|
+
variables:
|
|
9
|
+
DEFAULT_PYTHON: "3.14"
|
|
10
|
+
GIT_DEPTH: 0
|
|
11
|
+
|
|
12
|
+
cache:
|
|
13
|
+
key: ${CI_COMMIT_REF_SLUG}
|
|
14
|
+
paths:
|
|
15
|
+
- /root/.cache/uv
|
|
16
|
+
|
|
17
|
+
before_script:
|
|
18
|
+
- python -m pip install --upgrade pip
|
|
19
|
+
- pip install uv
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
ruff:
|
|
23
|
+
stage: linting
|
|
24
|
+
image: python:$DEFAULT_PYTHON
|
|
25
|
+
script:
|
|
26
|
+
- uv pip install --system -e ".[dev]"
|
|
27
|
+
- ruff check src tests
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
pytest:sanity:
|
|
31
|
+
stage: test
|
|
32
|
+
image: python:$PYTHON_VERSION
|
|
33
|
+
parallel:
|
|
34
|
+
matrix:
|
|
35
|
+
- PYTHON_VERSION: ["3.13", "3.14"]
|
|
36
|
+
script:
|
|
37
|
+
- uv pip install --system -e ".[dev]"
|
|
38
|
+
- pytest --junitxml=report.xml
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
pytest:coverage:
|
|
42
|
+
stage: coverage
|
|
43
|
+
image: python:$DEFAULT_PYTHON
|
|
44
|
+
script:
|
|
45
|
+
- uv pip install --system -e ".[dev]"
|
|
46
|
+
- pytest --junitxml=report.xml --cov=primlib --cov-report=xml --cov-report=term --cov-report=html
|
|
47
|
+
artifacts:
|
|
48
|
+
when: always
|
|
49
|
+
reports:
|
|
50
|
+
junit: report.xml
|
|
51
|
+
coverage_report:
|
|
52
|
+
coverage_format: cobertura
|
|
53
|
+
path: coverage.xml
|
|
54
|
+
paths:
|
|
55
|
+
- htmlcov/
|
|
56
|
+
expire_in: 1 months
|
|
57
|
+
coverage: '/^TOTAL.*\s+(\d+\%)$/'
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
build:
|
|
61
|
+
stage: build
|
|
62
|
+
image: python:$DEFAULT_PYTHON
|
|
63
|
+
script:
|
|
64
|
+
- uv pip install --system build
|
|
65
|
+
- python -m build
|
|
66
|
+
artifacts:
|
|
67
|
+
paths:
|
|
68
|
+
- dist/
|
|
69
|
+
rules:
|
|
70
|
+
- if: '$CI_COMMIT_TAG'
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
publish:
|
|
74
|
+
stage: publish
|
|
75
|
+
image: python:$DEFAULT_PYTHON
|
|
76
|
+
needs:
|
|
77
|
+
- build
|
|
78
|
+
id_tokens:
|
|
79
|
+
PYPI_ID_TOKEN:
|
|
80
|
+
aud: "pypi"
|
|
81
|
+
script:
|
|
82
|
+
- uv pip install --system twine
|
|
83
|
+
- twine upload --repository pypi --non-interactive dist/*
|
|
84
|
+
rules:
|
|
85
|
+
- if: '$CI_COMMIT_TAG'
|
primlib-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Lighthouse: https://gitlab.com/proebrock/lighthouse/
|
|
4
|
+
Copyright (c) 2021 Philipp Roebrock
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
primlib-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: primlib
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Primlib: a Python framework for handling 3D geometric primitives
|
|
5
|
+
Author-email: Philipp Roebrock <philipp.roebrock@fhgr.ch>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Lighthouse: https://gitlab.com/proebrock/lighthouse/
|
|
9
|
+
Copyright (c) 2021 Philipp Roebrock
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Project-URL: Homepage, https://gitlab.com/proebrock/primlib
|
|
30
|
+
Project-URL: Issues, https://gitlab.com/proebrock/primlib/issues
|
|
31
|
+
Requires-Python: >=3.10
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
License-File: LICENSE
|
|
34
|
+
Requires-Dist: matplotlib
|
|
35
|
+
Requires-Dist: numpy
|
|
36
|
+
Requires-Dist: plyfile
|
|
37
|
+
Requires-Dist: polyscope
|
|
38
|
+
Requires-Dist: pyembree2
|
|
39
|
+
Requires-Dist: scipy
|
|
40
|
+
Requires-Dist: trafolib
|
|
41
|
+
Provides-Extra: test
|
|
42
|
+
Requires-Dist: pytest; extra == "test"
|
|
43
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: pytest; extra == "dev"
|
|
46
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
47
|
+
Requires-Dist: ruff; extra == "dev"
|
|
48
|
+
Dynamic: license-file
|
|
49
|
+
|
|
50
|
+
# Primlib
|
|
51
|
+

|
|
52
|
+

|
|
53
|
+
|
|
54
|
+
Library for processing geometrical primitives like point clouds or triangle meshes.
|
|
55
|
+
|
|
56
|
+
## Features
|
|
57
|
+
- Class representation of a point cloud
|
|
58
|
+
- Class representation of a triangle mesh
|
|
59
|
+
- Class representation of a line set
|
|
60
|
+
- Main library has just NumPy and SciPy as external dependencies
|
|
61
|
+
- Fast 3d visualization using Polyscope library
|
|
62
|
+
- **Permissive License (MIT)**, code can be used in commercial software
|
|
63
|
+
|
|
64
|
+
## Requirements
|
|
65
|
+
- [Python](https://www.python.org/) >=3.10
|
|
66
|
+
- [NumPy](https://numpy.org/)
|
|
67
|
+
- [SciPy](https://scipy.org/)
|
|
68
|
+
- [Matplotlib](https://matplotlib.org/)
|
|
69
|
+
- [trafolib](https://gitlab.com/proebrock/trafolib) for represenation of rigid body transformations
|
|
70
|
+
- [plyfile](https://pypi.org/project/plyfile/) for loading PLY files
|
|
71
|
+
- [Polyscope](https://polyscope.run/py/) for visualization
|
|
72
|
+
- [pyembree2](https://pypi.org/project/pyembree2/) as wrapper for Intel Embree for mesh-point distance computations
|
|
73
|
+
- [pytest](https://docs.pytest.org/en/stable/) and [pytest-cov](https://pypi.org/project/pytest-cov/) for testing
|
|
74
|
+
- [Ruff](https://github.com/astral-sh/ruff) for linting
|
|
75
|
+
|
|
76
|
+
All dependencies are declared in [`pyproject.toml`](pyproject.toml).
|
|
77
|
+
|
|
78
|
+
## Installation
|
|
79
|
+
It is strongly recommended to use a **virtual environment**.
|
|
80
|
+
|
|
81
|
+
### For Users (Runtime Only)
|
|
82
|
+
This will install the core libraries needed to run Primlib, without any development tools or tests.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install primlib
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 2. For Developers
|
|
89
|
+
This installation is for **contributors** who want to run tests or modify the code.
|
|
90
|
+
|
|
91
|
+
1. Clone the repository:
|
|
92
|
+
```bash
|
|
93
|
+
git clone https://gitlab.com/proebrock/primlib.git
|
|
94
|
+
cd primlib
|
|
95
|
+
```
|
|
96
|
+
2. Create a virtual environment (recommended):
|
|
97
|
+
```bash
|
|
98
|
+
python -m venv .venv
|
|
99
|
+
source .venv/bin/activate # Linux / macOS
|
|
100
|
+
.venv\Scripts\activate # Windows
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
3. Install the project with development extras:
|
|
104
|
+
```bash
|
|
105
|
+
pip install -e ".[dev]"
|
|
106
|
+
```
|
|
107
|
+
4. Run ruff:
|
|
108
|
+
- As a linter:
|
|
109
|
+
```bash
|
|
110
|
+
ruff check
|
|
111
|
+
```
|
|
112
|
+
- As a formatter:
|
|
113
|
+
```bash
|
|
114
|
+
ruff format
|
|
115
|
+
```
|
|
116
|
+
5. Run all tests:
|
|
117
|
+
```bash
|
|
118
|
+
pytest
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## About me and the project
|
|
122
|
+
My name is Philipp Roebrock and I work as a lecturer at the Institute for Photonics and Robotics at the University of Applied Sciences of the Grisons [FHGR](https://www.fhgr.ch/) in Chur in Switzerland.
|
|
123
|
+
|
|
124
|
+
If you have any questions or suggestions please drop and issue or a personal message to `philipp DOT roebrock AT fhgr DOT ch`.
|
primlib-0.3.0/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Primlib
|
|
2
|
+

|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Library for processing geometrical primitives like point clouds or triangle meshes.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
- Class representation of a point cloud
|
|
9
|
+
- Class representation of a triangle mesh
|
|
10
|
+
- Class representation of a line set
|
|
11
|
+
- Main library has just NumPy and SciPy as external dependencies
|
|
12
|
+
- Fast 3d visualization using Polyscope library
|
|
13
|
+
- **Permissive License (MIT)**, code can be used in commercial software
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
- [Python](https://www.python.org/) >=3.10
|
|
17
|
+
- [NumPy](https://numpy.org/)
|
|
18
|
+
- [SciPy](https://scipy.org/)
|
|
19
|
+
- [Matplotlib](https://matplotlib.org/)
|
|
20
|
+
- [trafolib](https://gitlab.com/proebrock/trafolib) for represenation of rigid body transformations
|
|
21
|
+
- [plyfile](https://pypi.org/project/plyfile/) for loading PLY files
|
|
22
|
+
- [Polyscope](https://polyscope.run/py/) for visualization
|
|
23
|
+
- [pyembree2](https://pypi.org/project/pyembree2/) as wrapper for Intel Embree for mesh-point distance computations
|
|
24
|
+
- [pytest](https://docs.pytest.org/en/stable/) and [pytest-cov](https://pypi.org/project/pytest-cov/) for testing
|
|
25
|
+
- [Ruff](https://github.com/astral-sh/ruff) for linting
|
|
26
|
+
|
|
27
|
+
All dependencies are declared in [`pyproject.toml`](pyproject.toml).
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
It is strongly recommended to use a **virtual environment**.
|
|
31
|
+
|
|
32
|
+
### For Users (Runtime Only)
|
|
33
|
+
This will install the core libraries needed to run Primlib, without any development tools or tests.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install primlib
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 2. For Developers
|
|
40
|
+
This installation is for **contributors** who want to run tests or modify the code.
|
|
41
|
+
|
|
42
|
+
1. Clone the repository:
|
|
43
|
+
```bash
|
|
44
|
+
git clone https://gitlab.com/proebrock/primlib.git
|
|
45
|
+
cd primlib
|
|
46
|
+
```
|
|
47
|
+
2. Create a virtual environment (recommended):
|
|
48
|
+
```bash
|
|
49
|
+
python -m venv .venv
|
|
50
|
+
source .venv/bin/activate # Linux / macOS
|
|
51
|
+
.venv\Scripts\activate # Windows
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
3. Install the project with development extras:
|
|
55
|
+
```bash
|
|
56
|
+
pip install -e ".[dev]"
|
|
57
|
+
```
|
|
58
|
+
4. Run ruff:
|
|
59
|
+
- As a linter:
|
|
60
|
+
```bash
|
|
61
|
+
ruff check
|
|
62
|
+
```
|
|
63
|
+
- As a formatter:
|
|
64
|
+
```bash
|
|
65
|
+
ruff format
|
|
66
|
+
```
|
|
67
|
+
5. Run all tests:
|
|
68
|
+
```bash
|
|
69
|
+
pytest
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## About me and the project
|
|
73
|
+
My name is Philipp Roebrock and I work as a lecturer at the Institute for Photonics and Robotics at the University of Applied Sciences of the Grisons [FHGR](https://www.fhgr.ch/) in Chur in Switzerland.
|
|
74
|
+
|
|
75
|
+
If you have any questions or suggestions please drop and issue or a personal message to `philipp DOT roebrock AT fhgr DOT ch`.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = [
|
|
3
|
+
"setuptools >= 77.0.3",
|
|
4
|
+
"setuptools-scm >= 8"
|
|
5
|
+
]
|
|
6
|
+
build-backend = "setuptools.build_meta"
|
|
7
|
+
|
|
8
|
+
[project]
|
|
9
|
+
name = "primlib"
|
|
10
|
+
dynamic = ["version"]
|
|
11
|
+
description = "Primlib: a Python framework for handling 3D geometric primitives"
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
license = { file = "LICENSE" }
|
|
14
|
+
authors = [
|
|
15
|
+
{ name = "Philipp Roebrock", email = "philipp.roebrock@fhgr.ch" }
|
|
16
|
+
]
|
|
17
|
+
requires-python = ">=3.10"
|
|
18
|
+
|
|
19
|
+
dependencies = [
|
|
20
|
+
"matplotlib",
|
|
21
|
+
"numpy",
|
|
22
|
+
"plyfile",
|
|
23
|
+
"polyscope",
|
|
24
|
+
"pyembree2",
|
|
25
|
+
"scipy",
|
|
26
|
+
"trafolib",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.optional-dependencies]
|
|
30
|
+
test = ["pytest", "pytest-cov"]
|
|
31
|
+
dev = ["pytest", "pytest-cov", "ruff"]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Homepage = "https://gitlab.com/proebrock/primlib"
|
|
35
|
+
Issues = "https://gitlab.com/proebrock/primlib/issues"
|
|
36
|
+
|
|
37
|
+
[tool.setuptools_scm]
|
|
38
|
+
tag_regex = "^v(?P<version>\\d+\\.\\d+\\.\\d+.*)$"
|
|
39
|
+
version_scheme = "release-branch-semver"
|
|
40
|
+
local_scheme = "no-local-version"
|
|
41
|
+
write_to = "src/primlib/_version.py"
|
|
42
|
+
|
|
43
|
+
[tool.setuptools]
|
|
44
|
+
license-files = ["LICEN[CS]E*"]
|
|
45
|
+
|
|
46
|
+
[tool.setuptools.packages.find]
|
|
47
|
+
where = ["src"]
|
|
48
|
+
|
|
49
|
+
[tool.ruff]
|
|
50
|
+
line-length = 88
|
|
51
|
+
target-version = "py312"
|
|
52
|
+
|
|
53
|
+
[tool.ruff.lint]
|
|
54
|
+
select = [
|
|
55
|
+
"E", # pycodestyle errors
|
|
56
|
+
"F", # pyflakes
|
|
57
|
+
"W", # warnings
|
|
58
|
+
"I", # isort
|
|
59
|
+
"UP", # pyupgrade
|
|
60
|
+
"B", # flake8-bugbear
|
|
61
|
+
]
|
|
62
|
+
ignore = [
|
|
63
|
+
"B017", # assert-raises-exception
|
|
64
|
+
"BLE001", # blind-except
|
|
65
|
+
"LOG015", # root-logger-call
|
|
66
|
+
"TRY002", # raise-vanilla-class
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
[tool.ruff.format]
|
|
70
|
+
quote-style = "double"
|
|
71
|
+
indent-style = "space"
|
primlib-0.3.0/setup.cfg
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '0.3.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 3, 0)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = 'g9f7c96e5c'
|