Menu

Triangulation

Daniel P. Dougherty

The following Groovy script illustrates how to perform Delaunay triangulation using Snifflib.

First, we create a 2D space-filling pseudo random sequence called a Halton Sequence using Snifflib's PseudoRandom class.

import com.mockturtlesolutions.snifflib.datatypes.DblMatrix;
import com.mockturtlesolutions.snifflib.util.Triangulation;
import com.mockturtlesolutions.snifflib.util.PseudoRandom;

DATA = PseudoRandom.haltonSeq(50,2);
T = new Triangulation(DATA);

T.setPerturbationSize(0.001);
T.delaunay();

X = T.getTriangulation();

X.show("Indicies of Triangulation","00");


The result will look something like this when graphed.

<IMG SRC="http://iweb.dl.sourceforge.net/project/snifflib/Misc/SnifflibDelaunayExample.png" ALT="Delaunay Triangulation in Snifflib" WIDTH="500">


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.