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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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