Skip to main content

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-docs/py

teaser image

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 of potpourri3d!)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

signedheat3d-1.0.0.tar.gz (34.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

signedheat3d-1.0.0-cp314-cp314-win_amd64.whl (13.3 MB view details)

Uploaded CPython 3.14Windows x86-64

File details

Details for the file signedheat3d-1.0.0.tar.gz.

File metadata

  • Download URL: signedheat3d-1.0.0.tar.gz
  • Upload date:
  • Size: 34.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for signedheat3d-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fc39c749d29ce469e0326531c74493ea0d153784e66bfe3486e0ed8394a644cf
MD5 ff4588cbccd8c502664374605e8ae117
BLAKE2b-256 c2c96907d4fc662137b01b8de5f21bce5b715fdad4724381e0b1cd24f8e140e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for signedheat3d-1.0.0.tar.gz:

Publisher: deploy.yml on nzfeng/signed-heat-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file signedheat3d-1.0.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for signedheat3d-1.0.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e5ee544f18629094533cb232f3031666fd678b90ed007ad0fa82d3a77576f1ee
MD5 dac0e0e74786b11039a4a1d2b043330b
BLAKE2b-256 08d470dc75ac7a8e456b55554f98ff3c438473cdd680f68a5f1478cd9fe1708c

See more details on using hashes here.

Provenance

The following attestation bundles were made for signedheat3d-1.0.0-cp314-cp314-win_amd64.whl:

Publisher: deploy.yml on nzfeng/signed-heat-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page