Search Unity

Constrained Delaunay Triangulations

Discussion in 'Scripting' started by Charles Gill, Jul 30, 2009.

  1. Charles Gill

    Charles Gill

    Joined:
    Aug 1, 2008
    Posts:
    142
    I intend to port the CDT portion of CGAL (for non-commercial purposes) to C# unless someone knows of a good existing .NET version of this already (one that you've actually used).

    Thanks!

    Charles
     
  2. Sammual

    Sammual

    Joined:
    Oct 28, 2008
    Posts:
    176
    Please send me a PM when you have the CDT ported. I am a SQL guy and attempting to roll my own gave me a big headache.

    Thanks,
    Sammual
     
  3. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    PrimalCoder likes this.
  4. mathmos_

    mathmos_

    Joined:
    Oct 23, 2012
    Posts:
    2
    Hi there. Any way I could get my hands on that CDT implementation?
     
  5. karl_

    karl_

    Joined:
    Mar 4, 2010
    Posts:
    464
    The Poly2Tri project has a C# port: http://code.google.com/p/poly2tri/. I used it previously and found it met my needs.

    Edit- It looks like the Farseer physics implements the Poly2Tri code.
     
    Last edited: Feb 5, 2013
  6. goeland86

    goeland86

    Joined:
    Jan 14, 2013
    Posts:
    2
    karl_ have you managed to use the Farseer code for this?
    I've got a list of Vector3 that defines a polygon (convex AND concave, thus the need for CTD), and I can't seem to make heads or tails of what to use from their plugin. Project is a 2.5D game, so we've got some meshes and we're not building on top of FarSeer at all.

    Thanks for any help with this.
     
  7. Sjiggle

    Sjiggle

    Joined:
    Sep 12, 2012
    Posts:
    10
    I know this is an old topic just wanted to give my 2 cents:

    if you have a 3D polygon that you want to triangulate, I'd advice to find a good 2D constraint delaunay solution (poly2tri for example). In poly2tri you can extend their point class, so that you can store the original 3D vector with each 2D vector. The 2D vector is created by using a half way quaternion (to make sure opposite directions don't match) from your polygons normal towards Vector3.forward and multiply that to the points. The X and Y values are then used to triangulate.