Jump to content

Roof facing facet.


oschakravarthi
 Share

Recommended Posts

Thank you @JohnK

I now understood how the information is stored internally. The below function get the details.

var getFacetTrianglesOfMesh = function (mesh) {
            var indices = mesh.getIndices();
            var positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind);

            var nbFaces = indices.length / 3;

            var triangles = [];
            for (var i = 0; i < nbFaces; i++) {
                var triangle = [];
                for (var j = 0; j < 3; j++) {
                    var ind = (i * 3) + j;
                    var point = new BABYLON.Vector3(positions[ind], positions[ind + 1], positions[ind + 2]);
                    triangle.push(point);
                }

                triangles.push(triangle);
            }

            return triangle;
        };

Now I need to do face sampling. I need to divide each facet into a grid of equal sized cells. 

Any clue how to do this? Gone thru this article but could not understand. https://chrischoy.github.io/research/barycentric-coordinate-for-mesh-sampling/

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...