I am trying to use Rhino3dm as a simple polygonal modeler since it has good implementations of most primitive geometrical types that I require such as mesh, point, vector, polyline etc. Although, I’ve noticed that a lot of the useful methods such as ClosestPoint, GetNakedEdges, computing mesh area and so on are missing and are instead part of RhinoCompute. This basically renders Rhino3dm practically unusable on its own without using the Rhino compute server. It would be nice if you could make these method at least available in the polygonal case where NURBs are not necessary. Most of these algorithms for calculating these methods are freely available online or may be replicated using the methods already part of Rhino3dm.
Example compute mesh area in simple flat faces case:
static public double GetMeshArea(Rhino.Geometry.Mesh mesh)
{
double area = 0;
if (!mesh.Faces.ConvertQuadsToTriangles())
throw new Exception("Failed to convert quads to triangles");
foreach (var f in mesh.Faces)
{
if (!f.IsTriangle)
throw new Exception("Face is not triangle!");
var triangle = new Triangle3d(mesh.Vertices[f.A], mesh.Vertices[f.B], mesh.Vertices[f.C]);
area += triangle.Area;
}
return area;
}