• Stars
    star
    102
  • Rank 335,584 (Top 7 %)
  • Language
    Lua
  • License
    MIT License
  • Created almost 11 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Delaunay triangulation for convex polygon

Delaunay

Build Status Coverage Status License

delaunay is a Lua module for delaunay triangulation of a convex polygon.

##Download

###Git

git clone http://github.com/Yonaba/delaunay.git

###Archive

###LuaRocks

luarocks install delaunay

###MoonRocks

luarocks install --server=http://rocks.moonscript.org/manifests/Yonaba delaunay

##Installation Copy the file delaunay.lua inside your project folder, call it with require function. It will return the Delaunay module, keeping safe the global environment.

##Usage

The module provides 3 classes:

  • Point
  • Edge
  • Triangle

It also provides a single function named triangulate. This function accepts a variable list (vararg ...) of instances of class Point. Assuming those points are the vertices of a convex polygon, it returns a table of instances of the class Triangle forming a Delaunay triangulation of the given polygon.

A basic code example:

local Delaunay = require 'Delaunay'
local Point    = Delaunay.Point

-- Creating 10 random points
local points = {}
for i = 1, 10 do
  points[i] = Point(math.random() * 100, math.random() * 100)
end

-- Triangulating de convex polygon made by those points
local triangles = Delaunay.triangulate(unpack(points))

-- Printing the results
for i, triangle in ipairs(triangles) do
  print(triangle)
end

See the documentation for more details.

##Testing ###Specification

This repository include unit tests. You can run them using Telescope with the following command from the root foolder:

lua tsc -f specs/*

###Performance

You can run the random performance tests included with the following command from the root folder:

lua performance/bench.lua

##License This work is under MIT-LICENSE.
Copyright (c) 2013 Roland Yonaba

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Bitdeli Badge

More Repositories

1

Moses

Utility library for functional programming in Lua
Lua
604
star
2

Jumper

Fast, lightweight and easy-to-use pathfinding library for grid-based games
Lua
590
star
3

30log

30 lines library for object orientation in Lua
Lua
413
star
4

awesome-one-person-games

🎮 A curated list of successul games, made (quite) entirely by a lone gamedev.
352
star
5

Lua-Class-System

Lua Class System (LCS) is a small library which offers a clean, minimalistic but powerful API for (Pseudo) Object Oriented programming style using Lua.
Lua
62
star
6

Allen

An utility library to manipulate strings in Lua
Lua
45
star
7

strictness

Tracks accesses and assignments of undefined variables in Lua
Lua
36
star
8

love2d-assets-loader

Assets Loader for Löve2D Framework
Lua
36
star
9

FloodFill

Various floodfill algorithms implementation
Lua
18
star
10

Binary-Heaps

Implementation of binary heaps data structure in pure Lua
Lua
18
star
11

guard.lua

Minimalistic library providing Elixir-style guards for Lua
Lua
16
star
12

Steering-Behaviors

Steering behaviors algorithms for autonomously moving agents and flocks implemented in Lua
Lua
15
star
13

broad-phase-algorithms

Lua Implementation of space-partitioning techniques for broad-phase collision detection
Lua
14
star
14

Jumper-Benchmark

Benchmark tests for the pathfinding library Jumper featuring 2012 GPPC map set
Lua
12
star
15

tuple.lua

Minimal implementation of ordered n-tuples class in Lua
Lua
11
star
16

Raytracer

A basic raytracer written in Lua
Lua
11
star
17

Jumper-Examples

Demos and examples of use for the pathfinding library Jumper with various Lua frameworks and game engines
11
star
18

dijkstra-map

Demo illustrating the use of dijkstra map for turn-based pathfinding for multi agents on weighted grids
Lua
10
star
19

yonaba.github.com

Personal DevBlog Pages
CSS
7
star
20

character-physics-demo

A technical demo (made with Löve2D) implementing physics-based movement and jump with various time integration methods
Lua
7
star
21

Java-samples

Collection of Java snippets implemented for learning purposes
Java
7
star
22

uplink-psp

A small clone of Uplink Hacker Elite written in Lua for PSP
Lua
6
star
23

luigi-world

An old and minimalist platformer game with Luigi written in Lua for PSP
Lua
5
star
24

PiL3

Going through the exercices of the book Programming in Lua, Third Ed.
Lua
5
star
25

30logclasscommons

Plugin for compatibility between 30log and Class-commons
Lua
4
star
26

Starz-Puzzle

A small Lua puzzle game written for the sake of LÖVE
Lua
4
star
27

pascal-exercises

Collection of maths problems implemented in pascal programming language for learning purposes
Pascal
4
star
28

SOR

Library for solving linear equation system using Successive Over Relaxation method
Lua
4
star
29

smallpt-lua

Lua
4
star
30

adventofcode

My attempt at solving AdventOfCode Problems with Lua, on my spare times
Lua
3
star
31

lua-travis-coveralls

Getting Lua 5.1, 5.2 and LuaJit 2.0 specs to work with integration with Travis-CI and Coveralls.io
Shell
3
star
32

xcorr.bas

Adds cross correlation and autocorrelation functions to Microsoft Excel
VBA
3
star
33

treap.lua

A simple treap data structure implemented in Lua
Lua
3
star
34

Win64-Installer-ArcView3.x

ISS Script to generate A Windows x64 compatible setup of ESRI's ArcView3.x
Shell
2
star
35

lua-system-shell

Small old homebrew Lua shell written in Lua for PSP
Lua
2
star
36

hokuto-no-ken

Small old homebrew Lua game written in Lua for PSP
Lua
2
star
37

danzeff-lua-keyboard

Emulating Danzeff's Keyboard for LuaPlayerHM
Lua
2
star
38

Hydraulics

VB macros to evaluate hydraulics parameters. Exposes solvers as functions to Excel API
FreeBasic
2
star
39

mario-kart

A small and minimalist Mario Kart homebrew game written in Lua for PSP
Lua
2
star
40

Excel-Pour-Reseaux-Ramifies

Macro VBA associée à un classeur Excel pour le calcul et l'analyse de réseaux hydrauliques ramifiés.
Visual Basic
2
star
41

covid19_clustering_africa

Attempt at clustering African countries using country-level variables and COVID-19 prevalence
R
1
star
42

2ie-master-thesis-csl-style

CSL Style developed for 2iE students Master thesis
1
star
43

ID-em

Create unique identifiers for each entity in a ESRI Shapefile
1
star
44

the-labyrinth

A small technical raycasting demo written in Lua for PSP
Lua
1
star
45

ET0_Analysis_Burkina_Faso

R scripts for Figures and Data Analysis Accompanying an academic paper on reference evapotranspiration analysis in Burkina Faso
R
1
star
46

sivakumar.bas

A VBA module to calculate the rainy season onset/ending dates and the count of occurences of dry spells
VBA
1
star