How can I create an evenly distributed mesh from a shape?











up vote
1
down vote

favorite












I'm trying to convert some 2D shapes (without holes) into meshes with evenly distributed vertices.



Before the conversion the shapes are edge loops with no internal vertices.



After the conversion I want the following properties.




  • Every edge vertex should connect to some internal vertex.

  • The added vertices should be evenly placed within the shape or on the edge.

  • No added edge should cross outside the shape.


  • A parameter should be able to regulate how many vertices are added, like maximum edge length, minimum vertex density or some such thing. It doesn't matter all that much as long as the mesh doesn't end up very dense or sparse in the interior.



I'm going map vectors to the vertices in the end, that's why I want to create meshes with internal vertices.










share|cite|improve this question


























    up vote
    1
    down vote

    favorite












    I'm trying to convert some 2D shapes (without holes) into meshes with evenly distributed vertices.



    Before the conversion the shapes are edge loops with no internal vertices.



    After the conversion I want the following properties.




    • Every edge vertex should connect to some internal vertex.

    • The added vertices should be evenly placed within the shape or on the edge.

    • No added edge should cross outside the shape.


    • A parameter should be able to regulate how many vertices are added, like maximum edge length, minimum vertex density or some such thing. It doesn't matter all that much as long as the mesh doesn't end up very dense or sparse in the interior.



    I'm going map vectors to the vertices in the end, that's why I want to create meshes with internal vertices.










    share|cite|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm trying to convert some 2D shapes (without holes) into meshes with evenly distributed vertices.



      Before the conversion the shapes are edge loops with no internal vertices.



      After the conversion I want the following properties.




      • Every edge vertex should connect to some internal vertex.

      • The added vertices should be evenly placed within the shape or on the edge.

      • No added edge should cross outside the shape.


      • A parameter should be able to regulate how many vertices are added, like maximum edge length, minimum vertex density or some such thing. It doesn't matter all that much as long as the mesh doesn't end up very dense or sparse in the interior.



      I'm going map vectors to the vertices in the end, that's why I want to create meshes with internal vertices.










      share|cite|improve this question













      I'm trying to convert some 2D shapes (without holes) into meshes with evenly distributed vertices.



      Before the conversion the shapes are edge loops with no internal vertices.



      After the conversion I want the following properties.




      • Every edge vertex should connect to some internal vertex.

      • The added vertices should be evenly placed within the shape or on the edge.

      • No added edge should cross outside the shape.


      • A parameter should be able to regulate how many vertices are added, like maximum edge length, minimum vertex density or some such thing. It doesn't matter all that much as long as the mesh doesn't end up very dense or sparse in the interior.



      I'm going map vectors to the vertices in the end, that's why I want to create meshes with internal vertices.







      geometry triangulation






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked yesterday









      Steinbitglis

      1134




      1134






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          The devil is in the details, but the backbone of the algorithm would be as follows:



          Given some desired maximum edge length $m$



          1) refine the edges of the shape so no edge is longer than $m$. Let $V$ be the set of all resulting vertices.



          2) compute the Delauney triangulation $T$ of $V$



          3) add to $V$ vertices that are the centroids of the triangles in $T$ that have edges longer than $m$.



          4) update the Delauney triangulation $T$ of $V$. If $T$ has triangles with edges longer than $m$, go to step 3).



          5) Optionally smooth the distribution of vertices by computing each interior vertex to be the average of its neighbors.



          For more details see Sections 5 and 6 of Filling Holes in Meshes and the references there.






          share|cite|improve this answer





















            Your Answer





            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("mathjaxEditing", function () {
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            });
            });
            }, "mathjax-editing");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "69"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3005002%2fhow-can-i-create-an-evenly-distributed-mesh-from-a-shape%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote













            The devil is in the details, but the backbone of the algorithm would be as follows:



            Given some desired maximum edge length $m$



            1) refine the edges of the shape so no edge is longer than $m$. Let $V$ be the set of all resulting vertices.



            2) compute the Delauney triangulation $T$ of $V$



            3) add to $V$ vertices that are the centroids of the triangles in $T$ that have edges longer than $m$.



            4) update the Delauney triangulation $T$ of $V$. If $T$ has triangles with edges longer than $m$, go to step 3).



            5) Optionally smooth the distribution of vertices by computing each interior vertex to be the average of its neighbors.



            For more details see Sections 5 and 6 of Filling Holes in Meshes and the references there.






            share|cite|improve this answer

























              up vote
              2
              down vote













              The devil is in the details, but the backbone of the algorithm would be as follows:



              Given some desired maximum edge length $m$



              1) refine the edges of the shape so no edge is longer than $m$. Let $V$ be the set of all resulting vertices.



              2) compute the Delauney triangulation $T$ of $V$



              3) add to $V$ vertices that are the centroids of the triangles in $T$ that have edges longer than $m$.



              4) update the Delauney triangulation $T$ of $V$. If $T$ has triangles with edges longer than $m$, go to step 3).



              5) Optionally smooth the distribution of vertices by computing each interior vertex to be the average of its neighbors.



              For more details see Sections 5 and 6 of Filling Holes in Meshes and the references there.






              share|cite|improve this answer























                up vote
                2
                down vote










                up vote
                2
                down vote









                The devil is in the details, but the backbone of the algorithm would be as follows:



                Given some desired maximum edge length $m$



                1) refine the edges of the shape so no edge is longer than $m$. Let $V$ be the set of all resulting vertices.



                2) compute the Delauney triangulation $T$ of $V$



                3) add to $V$ vertices that are the centroids of the triangles in $T$ that have edges longer than $m$.



                4) update the Delauney triangulation $T$ of $V$. If $T$ has triangles with edges longer than $m$, go to step 3).



                5) Optionally smooth the distribution of vertices by computing each interior vertex to be the average of its neighbors.



                For more details see Sections 5 and 6 of Filling Holes in Meshes and the references there.






                share|cite|improve this answer












                The devil is in the details, but the backbone of the algorithm would be as follows:



                Given some desired maximum edge length $m$



                1) refine the edges of the shape so no edge is longer than $m$. Let $V$ be the set of all resulting vertices.



                2) compute the Delauney triangulation $T$ of $V$



                3) add to $V$ vertices that are the centroids of the triangles in $T$ that have edges longer than $m$.



                4) update the Delauney triangulation $T$ of $V$. If $T$ has triangles with edges longer than $m$, go to step 3).



                5) Optionally smooth the distribution of vertices by computing each interior vertex to be the average of its neighbors.



                For more details see Sections 5 and 6 of Filling Holes in Meshes and the references there.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered yesterday









                brainjam

                372214




                372214






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3005002%2fhow-can-i-create-an-evenly-distributed-mesh-from-a-shape%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Wiesbaden

                    Marschland

                    Dieringhausen