Hi @clement,
I did a Dispatch of the points based on Mesh.GetNakedEdgePointStatus
(bool array) and the result is puzzling, Point all over the mesh are considered naked.
Fig.1. These are reported as NakedEdge-points:
Fig.2. And these are considered non-naked edge points:
The pattern is consistent though, so I must be doing something wrong when I triangulate the mesh.
Starting from a IsValid mesh, what I’m subdividing each triangle into four smaller triangles. Like so:
Fig.3. Subdivision pattern (Update: Fixed typo, +vectors):
This is a Rhino mesh, and obviously I’m doing something in the wrong order. But this test mesh (pictured) is valid, but when I sudivide the mesh Box pcitured earlier in Fig 1 and Fig 2, the mesh is not considered valid.
The code is straight forward (following the pattern shown above):
public void SplitFace4(Mesh m, int faceA, int faceB, int faceC, double t)
{
//
// SPLIT EDGES IN HALF
//
// /\
// /__\
//
// /\
// /\/\
//
// Face corners
//
var ptA = m.Vertices[faceA];
var ptB = m.Vertices[faceB];
var ptC = m.Vertices[faceC];
//
// Find split point at mid points along the edges
//
var vecAB = new Vector3d(ptB - ptA);
var ptAB = new Point3d(t * vecAB.X, t * vecAB.Y, t * vecAB.Z) + ptA;
var vecBC = new Vector3d(ptC - ptB);
var ptBC = new Point3d(t * vecBC.X, t * vecBC.Y, t * vecBC.Z) + ptB;
var vecAC = new Vector3d(ptC - ptA);
var ptAC = new Point3d(t * vecAC.X, t * vecAC.Y, t * vecAC.Z) + ptA;
//
// Add the new points to the mesh
//
var i_ab = m.Vertices.Add(ptAB);
var i_bc = m.Vertices.Add(ptBC);
var i_ac = m.Vertices.Add(ptAC);
//
// INSERT SPLIT FACES
//
// Top /\
m.Faces.AddFace(faceA, i_ab, i_ac);
// Bottom /\/\
m.Faces.AddFace(i_ab, faceB, i_bc);
m.Faces.AddFace(i_bc, i_ac, i_ab);
m.Faces.AddFace(i_ac, i_bc, faceC);
}
After the insertion of the faces I remove the old ones and run
m_mesh.Normals.ComputeNormals();
m_mesh.Compact();
< scratching head >
// Rolf