Vertices arrangements in triangulated mesh


#1

Dear Friends, I forgot the vertices for triangulated mesh.
we know for each mesh face we have 0,1, 2, 3 vertices.
pt1 for vertex [0]
pt2 for vertex [1]
pt3 for vertex [2]
but I forgot about pt4, is it vertex1 for triangulated mesh?
i mean 1st and 4th vertex should be same for triangulated mesh… am I correct?

MeshFace mface = F_LIST.GetFace(i);
Point3f pt1 = new Point3f();
Point3f pt2 = new Point3f();
Point3f pt3 = new Point3f();
Point3f pt4 = new Point3f();
mmesh.Faces.GetFaceVertices(i, out pt1, out pt2, out pt3, out pt4);


(Giulio Piacentino) #2

Hi

1st and 4th vertex should be same for triangulated mesh… am I correct?

The 3rd and the 4th vertices should be the same for a triangular face. There is no need to add more than three vertices for any singular triangular face.

I hope this makes it clearer:

``
Rhino.Geometry.Mesh mesh = new Rhino.Geometry.Mesh();
mesh.Vertices.Add(0.0, 0.0, 1.0); //0
mesh.Vertices.Add(1.0, 0.0, 1.0); //1
mesh.Vertices.Add(2.0, 0.0, 1.0); //2

mesh.Faces.AddFace(0, 1, 2);
//mesh.Faces.AddFace(0, 1, 2, 2); //this is the same ``

See here the code that does that.
I hope this helps,

Giulio

Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com


#3

Thanks a Lot! I was confused about the last vertex, if I need to use in the code.
last two indices are the same. Thanks !