Menu

Polygon triangulation

Help
2016-05-24
2016-06-08
  • Massimo Zanoletti

    Hi to all
    I have coordinates those represent a polygon (often with hole(s)). I need to obtain "triangulation" of the polygon so I can create (at runtime) a mesh (TGLFreeForm, not TGLMesh) with triangles, and the mesh must represent the polygon itself.
    Problem is that polygon coords are nown only at runtime.

    A second way should be to crete directly the mesh (FreeForm) using the polygon coords.

    Can anyone help me?

    Thanks in advance
    Massimo

     
    • lnebel

      lnebel - 2016-05-25

      Your question is a bit unclear, but if you mean the triangulation algorithm
      itself, you should look into Delaunay triangulation or something similar,
      e.g., the "Triangle" library at https://www.cs.cmu.edu/~quake/triangle.html

      Lars

      Fra: Massimo Zanoletti [mailto:massimoz@users.sf.net]
      Sendt: 24. maj 2016 09:40
      Til: [glscene:discussion] 93606@discussion.glscene.p.re.sf.net
      Emne: [glscene:discussion] Polygon triangulation

      Hi to all
      I have coordinates those represent a polygon (often with hole(s)). I need to
      obtain "triangulation" of the polygon so I can create (at runtime) a mesh
      (TGLFreeForm, not TGLMesh) with triangles, and the mesh must represent the
      polygon itself.
      Problem is that polygon coords are nown only at runtime.

      A second way should be to crete directly the mesh (FreeForm) using the
      polygon coords.

      Can anyone help me?

      Thanks in advance
      Massimo


      Polygon triangulation
      https://sourceforge.net/p/glscene/discussion/93606/thread/b18cfba4/?limit=2 5#b004


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/glscene/discussion/93606/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      • Massimo Zanoletti

        Thanks for reply.
        More simply, what I need is to transform a polygon into a mesh, or better: create a TGLFreeform starting from a sequence of coords of a polygon (sometimes the polygon is complex, with holes inside).
        As first step, the mesh can be 2D (without extrusion).

         
        • Massimo Zanoletti

          Basically what i need is like this sample.
          It's only a sample.
          Imagine I want to mesh a polygon like the capital A character.
          It's a "complex" polygon with a hole inside.
          As you see in the picture, on the left there are vertex of (two) polygons.
          On the right it's showed what I need as result. A triangulation subdivision starting from vertex of polygon.

           
  • Jerome.D (BeanzMaster)

    Hi check the "MeshLines" in the "Examples" branches in SVN

     
    • Massimo Zanoletti

      Thanks for suggestion.
      It seems interesting, but I have a request.
      Because of for my application I use an older version of GLScene (that hasn't GLMeshLines unit), is there someone who can provide me the executable of that sample, just to see if it's useful for my purposes.
      I wouldn't install new version just to test the sample.
      I'll do later, in case the sample will be useful for me.

      Thanks in advance
      Massimo

       

Log in to post a comment.

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.