Re: DelaunayTriangulation[] output
- To: mathgroup at smc.vnet.net
- Subject: [mg83211] Re: DelaunayTriangulation[] output
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 15 Nov 2007 05:35:22 -0500 (EST)
- Organization: Uni Leipzig
- References: <fhegn1$m6p$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi,
don't use DelaunyTriangulation[].
ListPlot3D[] create already an Delauny
triangulation for the data and
points = Table[{Random[], Random[]}, {100}];
data = ListPlot3D[Append[#, 0] & /@ points, Mesh -> All];
Cases[data, _GraphicsComplex, Infinity] /.
GraphicsComplex[pnts_, pdata_, ___] :> {Most /@ pnts,
Cases[pdata, _Polygon, Infinity][[1]] /. Polygon[lst_] :> lst}
will produce a list
{points,{vertexNumbersOfTheFirstTriangle,vertexNumbersOfTheSecondTriangle,...}}
Regards
Jens
Dominick wrote:
> Hi guys I was wondering if you could help me with a couple of problems im having. I'm writing a program that when given two images it creates a morph in between them.The algorithm im implementing uses control points i choose on the image and them triangulates the the images using those control points.I then use the subsquent triangles to create a 1 to 1 correspondance between the 2 images. Im using the DelaunayTriangulation[] command to do the triangulation for me.Well my problem is the output of DelaunayTriangulation. I need a triangle list ie;
>
>
> i j k
> 1 5 2
> 2 3 7
> . . .
>
>
> where i,j,k are the vertices of the triangle
> but DelaunayTriangulation outputs an adjacency list ie
>
>
>
> { {i,{points that are connected to i},..}
>
>
> I was wondering if anyone knew how to convert this list to the triangle based list i need.If i get this figured out then 90%+ of the program is done.I appreciate any help.
>