Python bindings for the signed-heat-3d library, which implements the Signed Heat Method for generalized signed distance.
Project description
signedheat3d (Python package)
Documentation lives at https://nzfeng.github.io/signed-heat-3d/py
A Python library implementing the Signed Heat Method for computing robust signed distance fields (SDFs) to polygon meshes and point clouds in 3D.
- The original C++ code lives at signed-heat-3d.
- If you're interested in using the Signed Heat Method on 2D surface domains, rather than in 3D Euclidean space, check out the signed heat method implementation in
potpourri3d. (The overall organization of this repository was inspired by that ofpotpourri3d!)
Installation
The recommended way to install signedheat3d is via PyPI:
pip install signedheat3d
You can also clone the repository and install it from source:
git clone --recurse-submodules https://github.com/nzfeng/signed-heat-python.git
cd signed-heat-python
pip install .
If you do not clone recursively, some submodules or sub-submodules will not clone. Initialize/update these submodules by running git submodule update --init --recursive or git submodule update --recursive.
Dependencies
This project has the following submodules, which should have been installed in the previous step.
You may need to install Boost since signed-heat-3d depends on amgcl, which depends on Boost. Pip-installing signed-heat-3d should download Boost if it is not found on your system, but Boost can also be installed on macOS using brew install boost, and the necessary modules on Ubuntu using
sudo apt-get -y update
sudo apt-get -y install libboost-dev libboost-test-dev libboost-program-options-dev libboost-serialization-dev
Windows users would follow the instructions on the Boost website.
Demo program
This repository also contains a demo Python program at test/demo.py, using Polyscope for visualization. The demo program at test/demo.py uses the following Python libraries, which can each be installed via pip install:
To run the demo program, pip-install the package using the instructions described above. Then cd into the top level of the directory, and run
python3 test/demo.py path/to/mesh/or/pointcloud
Input / Output
Input / output meshes can be any one of the following types ("Supported file types"), including OBJ, PLY, STL, and OFF.
Point clouds are currently assumed to have file extension .pc and consist of newline-separated 3D point positions (denoted by leading char v) and point normal vectors (denoted by leading char vn).
Command line arguments
In addition to the mesh file, you can pass several flags.
| flag | default | purpose |
|---|---|---|
--g, --grid |
False |
Solve on a background grid. By default, the domain will be discretized as a tet mesh. |
--b |
np.array([1.0, 1.0, 1.0, -1.0, -1.0, -1.0], dtype=np.float64)) |
Set the 3D positions of the minimum & maximum corners of the rectangular domain. If the corner positions are not valid, a bounding box will automatically be computed. |
--v, --verbose |
Off | Verbose output. Off by default. |
--s |
np.array([32, 32, 32], dtype=np.int64)) |
Sets the resolution of the domain, by defining the number of nodes in each dimension. If solving on a tet mesh, only the first value is relevant. |
--l, --headless |
Off | Don't use the GUI, and automatically solve for & export the generalized SDF. |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file signedheat3d-0.1.0.tar.gz.
File metadata
- Download URL: signedheat3d-0.1.0.tar.gz
- Upload date:
- Size: 34.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65dd3954c7f80fa1d22e0c77d36a323e5d6763c9ce1299bf38648d6f4e589732
|
|
| MD5 |
b1d1936be4c53994677e507db2d0bde9
|
|
| BLAKE2b-256 |
0f3347dade6f1d8c63b177c2ee71ba76238a447ba2b83d58ab132dc4c470d317
|
Provenance
The following attestation bundles were made for signedheat3d-0.1.0.tar.gz:
Publisher:
deploy.yml on nzfeng/signed-heat-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
signedheat3d-0.1.0.tar.gz -
Subject digest:
65dd3954c7f80fa1d22e0c77d36a323e5d6763c9ce1299bf38648d6f4e589732 - Sigstore transparency entry: 375333726
- Sigstore integration time:
-
Permalink:
nzfeng/signed-heat-python@bf47c5dae6c3d2de3303a8379ccd4355af85cec7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nzfeng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@bf47c5dae6c3d2de3303a8379ccd4355af85cec7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file signedheat3d-0.1.0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: signedheat3d-0.1.0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 13.2 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8067a90f43c11c32f74358726d4485264c534f2944827f968a07bd4d2eb3a67c
|
|
| MD5 |
9cb6e8b584e4f689b2c212a2c95052ef
|
|
| BLAKE2b-256 |
84c77285dfa45f043d6514ad6307aba2382f6376b97fc33e9ca330f59d5fb5b2
|
Provenance
The following attestation bundles were made for signedheat3d-0.1.0-cp313-cp313-win_amd64.whl:
Publisher:
deploy.yml on nzfeng/signed-heat-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
signedheat3d-0.1.0-cp313-cp313-win_amd64.whl -
Subject digest:
8067a90f43c11c32f74358726d4485264c534f2944827f968a07bd4d2eb3a67c - Sigstore transparency entry: 375333728
- Sigstore integration time:
-
Permalink:
nzfeng/signed-heat-python@bf47c5dae6c3d2de3303a8379ccd4355af85cec7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nzfeng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@bf47c5dae6c3d2de3303a8379ccd4355af85cec7 -
Trigger Event:
push
-
Statement type: