GithubHelp home page GithubHelp logo

trisect's Introduction

Trisect

Sample edges of the delaunay triangulation.
Blazingly fast and exact.
Built with Rust

Pepy Total Downlods

Contents

Trisect is a package to sample edges of the Delaunay triangulation. It is very fast and converges in limit to the entire Delaunay triangulation, specially in lower dimensions. Trisect only returns edges from the Delaunay triangulation, so the resulting triangulation is always a subset of the Delaunay.

Installation

Pre-built packages currently for MacOS, Windows and Linux systems are available in PyPI and can be installed with:

pip install trisect

On uncommon architectures, you may need to first install Cargo before running pip install trisect.

Usage

from trisect import delaunay
edges = delaunay(points, n_points=2000, parallel=False)

Parameters:

  • points: numpy array of shape (samples,features) with the data points.
  • n_points: This determines the number of points sampled by the algorithm. More points equates for a denser triangulation but slows the algorithm. Note that n_points also equates to the maximum number of edges that it will attempt to find. Default is 1000.
  • parallel: boolean (default True)

Returns:

  • edges: numpy array (m, 2) corresponding to the found edges, m is always less than n_points.

How does it work?

Trisect works in exploiting the connection of the Delaunay triangulation and the Voronoi cover. Given a Delaunay triangulation is the nerve of a Voronoi cover, it means that an edge (i,j) belongs to the triangulation if there exists some point in the vector space such that its first nearest neighbors are i and j. The method simply randomly samples a point and saves the two nearest neighbours. Very paralelizable and with a sufficient number of samples creates all Delaunay edges.

trisect's People

Contributors

antonio-leitao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.