Skip to main content

Topological H-signature

Project description

H-Signature

A C++ or Python Library for computing the h-signature as defined in [1].

What is the H-signature? In the simplest case, it tells you whether two closed 3D curves are linked, or unlinked. The figure below shows some examples. Four visual examples of the H-signature

In the general case, the H-signature is computed between one closed curve $\tau$ and a skeleton of closed curves $S=\{S_1,\dots,S_m\}$. In code, each curve is a matrix of [3xN] (C++) or [Nx3] (Python) where N is the number of points in the curve. The H-signature is a vector (ordered list) of integers, where each element correspond to the h-signature of $\tau$ with respect to one curve in $S$.

Installation

For python:

pip install h-signature

For C++:

# The only option we offer is building from source with cmake 
git clone git@github.com:UM-ARM-Lab/h-signature.git
cd h-signature
mkdir build
# The only dependency is Eigen3
sudo apt install libeigen3-dev
# Build and run tests
cd build
cmake ..
make
ctest

API

There is only one function!

# Python with numpy
from h_signature.h_signature_np import get_h_signature
# Tau is an [Nx3] numpy array and skeleton is a dict of [3xN] numpy arrays
h_sig = get_h_signature(tau, skeleton)
print(h_sig)
// C++ with Eigen
#include <h_signature/h_signature.hpp>
// The above header has these typedefs
// typedef Eigen::Matrix3Xd Loop;
// typedef std::map<std::string, Eigen::Matrix3Xd> Skeleton;

// And this is the function, that's it! 
HSignature get_h_signature(Loop const &loop, Skeleton const & skeleton);

Citation

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

h_signature-0.0.5.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

h_signature-0.0.5-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file h_signature-0.0.5.tar.gz.

File metadata

  • Download URL: h_signature-0.0.5.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for h_signature-0.0.5.tar.gz
Algorithm Hash digest
SHA256 e7bab0d3ec1f9fc11c90454970bf363321845815af3677b601894bf4d462b8fc
MD5 be3404aa96d23388cdd9e7273aef39c6
BLAKE2b-256 df5bedffe55ce015a9789733bec6d4c4ccf5398e7e3747009614b33622c52f18

See more details on using hashes here.

File details

Details for the file h_signature-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: h_signature-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for h_signature-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 125483a1fe5721d5a76a7c7c442a8d88711d1bef93da10da1690301cd749fa4a
MD5 b627548b695bfea26b5e8df6cfaef19b
BLAKE2b-256 8c945bda44b7763baa5f56915b1ef5763be4be04364d5c0497518f3b2b5714aa

See more details on using hashes here.

Supported by

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