public MeshNormals(IMesh mesh, NormalsTypes eType = NormalsTypes.Vertex_OneRingFaceAverage_AreaWeighted) { Mesh = mesh; NormalType = eType; Normals = new DVector <Vector3d>(); VertexF = Mesh.GetVertex; }
public static Vector3d QuickCompute(DMesh3 mesh, int vid, NormalsTypes type = NormalsTypes.Vertex_OneRingFaceAverage_AreaWeighted) { Vector3d sum = Vector3d.Zero; Vector3d n, c; double a; foreach (int tid in mesh.VtxTrianglesItr(vid)) { mesh.GetTriInfo(tid, out n, out a, out c); sum += a * n; } return(sum.Normalized); }