public static double calcArea(Point3d p1, Point3d p2, Point3d p3) {
Vector3d v1 = p3 - p1;
Vector3d v2 = p2 - p1;
return Math.Abs(v2.CrossProduct(v1).Length * 0.5);
}
public static double calc3DFaceArea(Face f) {
if (f == null ) return 0.0;
Point3d[] vts = new Point3d[4];
for (short i = 0; i <= 3; i++)
vts[i] = f.GetVertexAt(i);
if (vts[3].IsEqualTo(vts[2])) {
return calcArea(vts[0],vts[1],vts[2]);
} else {
return calcArea(vts[0], vts[1], vts[3]) + calcArea(vts[1], vts[2], vts[3]);
}
}