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.
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
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
Hashes for h_signature-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 125483a1fe5721d5a76a7c7c442a8d88711d1bef93da10da1690301cd749fa4a |
|
MD5 | b627548b695bfea26b5e8df6cfaef19b |
|
BLAKE2b-256 | 8c945bda44b7763baa5f56915b1ef5763be4be04364d5c0497518f3b2b5714aa |