public static Vector3D[] ComputeNormalVertex(TriMesh mesh, EnumNormal type) { if (type == null) { type = EnumNormal.UniformWeight; } Vector3D[] normal = null; switch (type) { case EnumNormal.AreaWeight: normal = ComputeNormalAreaWeight(mesh); break; case EnumNormal.SphereInscribed: normal = ComputeNormalSphereInscribed(mesh); break; case EnumNormal.TipAngleWeight: normal = ComputeNormalTipAngleWeight(mesh); break; case EnumNormal.UniformWeight: normal = ComputeNormalUniformWeight(mesh); break; } return(normal); }
public static Vector3D[] ComputeNormalVertex(TriMesh mesh, EnumNormal type) { if (type == null) { type=EnumNormal.UniformWeight ; } Vector3D[] normal = null; switch (type) { case EnumNormal.AreaWeight: normal= ComputeNormalAreaWeight(mesh); break; case EnumNormal.SphereInscribed: normal = ComputeNormalSphereInscribed(mesh); break; case EnumNormal.TipAngleWeight: normal = ComputeNormalTipAngleWeight(mesh); break; case EnumNormal.UniformWeight: normal = ComputeNormalUniformWeight(mesh); break; } return normal; }
public static void SetUpVertexNormal(TriMesh mesh, EnumNormal type) { Vector3D[] normal = TriMeshUtil.ComputeNormalVertex(mesh, type); for (int i = 0; i < mesh.Vertices.Count; i++) { mesh.Vertices[i].Traits.Normal = normal[i]; } }
public static void SetUpVertexNormal(TriMesh mesh,EnumNormal type) { Vector3D[] normal = TriMeshUtil.ComputeNormalVertex(mesh,type); for (int i = 0; i < mesh.Vertices.Count; i++) { mesh.Vertices[i].Traits.Normal = normal[i]; } }
private void Normal_Click(object sender, EventArgs e) { EnumNormal type = (EnumNormal)((ToolStripMenuItem)sender).Tag; TriMeshUtil.SetUpVertexNormal(Mesh, type); }