Divide square faces into triangles
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
i have a faces matrix and i want to divide it into triangles
e.g. faces is a 100x4 matrix
and i want the same faces as triangles e.g. 123x3 ?
i tried it with the delaunayTriangulation but it distorts my mesh.
thank you
0 commentaires
Réponse acceptée
Matt J
le 3 Jan 2020
Modifié(e) : Matt J
le 3 Jan 2020
If the vertices of the squares are all pre-ordered in counter-clockwise or clock-wise order, I think you could just do,
Triangulation=[ Faces(:,[1,2,3]) ; Faces(:,[3,4,1])] ;
If the vertices are not pre-ordered, it wouldn't be too difficult to loop through and sort them first.
3 commentaires
Plus de réponses (1)
Matt J
le 3 Jan 2020
I think you would have to do the following steps in a loop over all the faces,
- FInd a 2D coordinate system for the plane passing through each face
- Convert the 3D coordinates of each of the faces vertice to 2D coordinates
- Do a 2D Delaunay tringulation
0 commentaires
Voir également
Catégories
En savoir plus sur Delaunay Triangulation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!