Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Algorithms
  4. Triangulation inside a contour

Triangulation inside a contour

Scheduled Pinned Locked Moved Algorithms
csscomalgorithmsquestion
5 Posts 2 Posters 52 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 15058665
    wrote on last edited by
    #1

    Hello I have a home-made program that generates 4 BMP files (top inside, top outside, back inside, back outside) with contour lines for my luthier activity as a hobbyist from another BMP with the contour of the arch and the center line, and the height of the arch. It perfectly works, I crafted 3 violins and 3 cellos with original shapes, they work perfectly. Now, as the program computes the altitude of each point, I would like to generate 3D models from the results. At first, I look from a 2D point of view: I make a list of consecutive 2D vertices (separated at a quite constant distance) that draws the contour of the instrument. I'd like a simple triangulation of the whole instrument, ie. make a 2D mesh inside the contour. I know there are algorithms like Delaunay, but I wanted to know if there is a simple way to do that. See this picture: https://i.servimg.com/u/f88/17/72/22/03/triang10.png - the blue line is the contour I want to fill - the black grid is a grid whose square size depends on the precision I want - I would triangulate the inner part of the instrument with squares (made of 2 triangles) like the green ones - the red line show the case when the 3 vertices of a triangle would be inside the contour but should'nt be drawn as part of it is outside of the contour Now I have 2 questions: - Is there an easy way to detect these triangles that are partly outside of the contour, but have their summit inside? - Is there an easy way to triangulate the remaining parts between the contour and the fully inside squares without using a complicated algorithm like Delaunay? Thank you David

    L 1 Reply Last reply
    0
    • M Member 15058665

      Hello I have a home-made program that generates 4 BMP files (top inside, top outside, back inside, back outside) with contour lines for my luthier activity as a hobbyist from another BMP with the contour of the arch and the center line, and the height of the arch. It perfectly works, I crafted 3 violins and 3 cellos with original shapes, they work perfectly. Now, as the program computes the altitude of each point, I would like to generate 3D models from the results. At first, I look from a 2D point of view: I make a list of consecutive 2D vertices (separated at a quite constant distance) that draws the contour of the instrument. I'd like a simple triangulation of the whole instrument, ie. make a 2D mesh inside the contour. I know there are algorithms like Delaunay, but I wanted to know if there is a simple way to do that. See this picture: https://i.servimg.com/u/f88/17/72/22/03/triang10.png - the blue line is the contour I want to fill - the black grid is a grid whose square size depends on the precision I want - I would triangulate the inner part of the instrument with squares (made of 2 triangles) like the green ones - the red line show the case when the 3 vertices of a triangle would be inside the contour but should'nt be drawn as part of it is outside of the contour Now I have 2 questions: - Is there an easy way to detect these triangles that are partly outside of the contour, but have their summit inside? - Is there an easy way to triangulate the remaining parts between the contour and the fully inside squares without using a complicated algorithm like Delaunay? Thank you David

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I have some large scale digital maps I "transform" (uniform colors; removing noise). I can sample and rewrite 100,000,000 pixels in "no time at all". You (just) need to get some hits on different colors in your polygons. You also have an (apparent) "adjacency rule" happening.

      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

      M 1 Reply Last reply
      0
      • L Lost User

        I have some large scale digital maps I "transform" (uniform colors; removing noise). I can sample and rewrite 100,000,000 pixels in "no time at all". You (just) need to get some hits on different colors in your polygons. You also have an (apparent) "adjacency rule" happening.

        "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

        M Offline
        M Offline
        Member 15058665
        wrote on last edited by
        #3

        Sorry, was it an answer for me about triangulation?

        L 1 Reply Last reply
        0
        • M Member 15058665

          Sorry, was it an answer for me about triangulation?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Yeah ... dots inside your triangles. You wanted "simple".

          "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

          M 1 Reply Last reply
          0
          • L Lost User

            Yeah ... dots inside your triangles. You wanted "simple".

            "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

            M Offline
            M Offline
            Member 15058665
            wrote on last edited by
            #5

            Sure, but I'm sorry I don't understand your answer so. Is there somewhere an explanation of that, please?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups