本文整理汇总了C#中GraphicResearchHuiZhao.TriMesh.GetVertex方法的典型用法代码示例。如果您正苦于以下问题:C# TriMesh.GetVertex方法的具体用法?C# TriMesh.GetVertex怎么用?C# TriMesh.GetVertex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicResearchHuiZhao.TriMesh
的用法示例。
在下文中一共展示了TriMesh.GetVertex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComputeAngle
public static List<double> ComputeAngle(TriMesh.Face face)
{
List<double> angles = new List<double>();
double angle1 = ComputeAngle(face.GetVertex(0).HalfEdge);
double angle2 = ComputeAngle(face.GetVertex(1).HalfEdge);
double angle3 = ComputeAngle(face.GetVertex(2).HalfEdge);
angles.Add(angle1);
angles.Add(angle2);
angles.Add(angle3);
return angles;
}
示例2: ComputeAreaFaceTwo
//face area
public static double ComputeAreaFaceTwo(TriMesh.Face face)
{
Vector3D v1 = new Vector3D(face.GetVertex(0).Traits.Position.x,
face.GetVertex(0).Traits.Position.y,
face.GetVertex(0).Traits.Position.z);
Vector3D v2 = new Vector3D(face.GetVertex(1).Traits.Position.x,
face.GetVertex(1).Traits.Position.y,
face.GetVertex(1).Traits.Position.z);
Vector3D v3 = new Vector3D(face.GetVertex(2).Traits.Position.x,
face.GetVertex(2).Traits.Position.y,
face.GetVertex(2).Traits.Position.z);
double a = Math.Sqrt((v1.x - v2.x) * (v1.x - v2.x)
+(v1.y - v2.y) * (v1.y - v2.y)
+(v1.z - v2.z) * (v1.z - v2.z));
double b = Math.Sqrt((v3.x - v2.x) * (v3.x - v2.x)
+(v3.y - v2.y) * (v3.y - v2.y)
+(v3.z - v2.z) * (v3.z - v2.z));
double c = Math.Sqrt((v1.x - v3.x) * (v1.x - v3.x)
+(v1.y - v3.y) * (v1.y - v3.y)
+(v1.z - v3.z) * (v1.z - v3.z));
double p = (a + b + c) / 2;
double area=Math.Sqrt(p * (p - a) * (p - b) * (p - c));
return area;
}
示例3: ComputeFaceNormals
public Vector3D ComputeFaceNormals(TriMesh.Face f)
{
Vector3D p0 = f.GetVertex(0).Traits.Position;
Vector3D p1 = f.GetVertex(1).Traits.Position;
Vector3D p2 = f.GetVertex(2).Traits.Position;
return (p1 - p0).Cross(p2 - p0).Normalize();
}