Encerrado

PHP Delaunay Triangulator Class

Want a simple PHP class that performs Delaunay Triangulation in memory. It takes as input a list of nodes, and then calculates a list of triangles.

In particular it should be optimizied for adding a single new node very quickly (and adjusting the triangle list accordingly)

The main output is to be able to find the nodes that make up the largest triangle (in area).

## Deliverables

Want a simple PHP class that performs Delaunay Triangulation in memory. It takes as input a list of nodes, and then calculates a list of triangles.

In particular it should be optimizied for adding a single new node very quickly (and adjusting the triangle list accordingly)

The main output is to be able to find the nodes that make up the largest triangle (in area).

The PHP class should have methods similar to

#Adds a single node to the list

function addNode($x,$y,$autocompute = false) {}

#Runs the Triangulation

function computeTriangles() {}

#Returns a 3 element array containing the nodes of the largest triangle

function findBiggestTrigangle() { return array($nodes); }

--

The first function has the autocompute option, so the calling program, can simply add a node to the list. Or can choose automatically update the internal list of triangles.

Ideally when autocompute=true, the addNote function will use a optimization to just update the triangle list without recomputing the whole list. (ie just redoes the triangles around the node)

---

An example program could be:

$dt = new DelaunayTriangulator();

$dt->AddNode(1,1,false);

$dt->AddNode(10,1,false);

$dt->AddNode(10,10,false);

$dt->AddNode(1,10,false);

$dt->AddNode(3,7,false);

$dt->AddNode(6,4,false);

$dt->computeTriangles();

$tri = $td->findBiggestTrigangle();

print_r($tri);

/*

array(

array(1,1),

array(6,4),

array(3,7)

)

*/

$dt->AddNode(4,4,true);

$tri = $td->findBiggestTrigangle();

print_r($tri);

/*

array(

array(10,10),

array(3,7),

array(6,4)

)

*/

Habilidades: Engenharia, PHP, Gestão de projetos, Arquitetura de software, Teste de Software, Hospedagem Web, Gestão de Site , Teste de Website

Ver mais: delaunay triangulation php class, triangle, DT, class memory project, simple management php, delaunay triangulation function, simple delaunay triangulation, simple array project, php project output, simple triangulation, delaunay class, php node, project class management, php adjusting, simple delaunay, delaunay triangle, delaunay triangulation simple, class management project, delaunay, memory management project, memory management , calling php, php input output, delaunay triangulation, project list php

Acerca do Empregador:
( 3 comentários ) Ffestiniog, United Kingdom

ID do Projeto: #2991890