示例#1
0
        private static double GetMeshArea(IOnMesh mesh)
        {
            double area = 0.0;

            if (null != mesh)
            {
                OnMassProperties mp = new OnMassProperties();
                if (mesh.AreaMassProperties(ref mp, true))
                {
                    area = Math.Abs(mp.Area());
                }
            }
            return(area);
        }
示例#2
0
        private static double GetBrepArea(IOnBrep brep)
        {
            double area = 0.0;

            if (null != brep)
            {
                OnMassProperties mp = new OnMassProperties();
                if (brep.AreaMassProperties(ref mp, true))
                {
                    area = Math.Abs(mp.Area());
                }
            }
            return(area);
        }
示例#3
0
        private static double GetSurfaceArea(IOnSurface srf)
        {
            double area = 0.0;

            if (null != srf)
            {
                OnMassProperties mp = new OnMassProperties();
                if (srf.AreaMassProperties(ref mp, true))
                {
                    area = Math.Abs(mp.Area());
                }
            }
            return(area);
        }
示例#4
0
        private static double GetCurveArea(IOnCurve crv, double tol)
        {
            double area = 0.0;

            if (null != crv && crv.IsClosed())
            {
                OnPlane plane = new OnPlane();
                if (crv.IsPlanar(plane, tol))
                {
                    OnBoundingBox    bbox  = crv.BoundingBox();
                    On3dPoint        point = plane.ClosestPointTo(bbox.Center());
                    OnMassProperties mp    = new OnMassProperties();
                    if (crv.AreaMassProperties(point, plane.Normal(), ref mp))
                    {
                        area = Math.Abs(mp.Area());
                    }
                }
            }
            return(area);
        }
 private static double GetSurfaceArea(IOnSurface srf)
 {
     double area = 0.0;
       if (null != srf)
       {
     OnMassProperties mp = new OnMassProperties();
     if (srf.AreaMassProperties(ref mp, true))
       area = Math.Abs(mp.Area());
       }
       return area;
 }
 private static double GetMeshArea(IOnMesh mesh)
 {
     double area = 0.0;
       if (null != mesh)
       {
     OnMassProperties mp = new OnMassProperties();
     if (mesh.AreaMassProperties(ref mp, true))
       area = Math.Abs(mp.Area());
       }
       return area;
 }
 private static double GetCurveArea(IOnCurve crv, double tol)
 {
     double area = 0.0;
       if (null != crv && crv.IsClosed())
       {
     OnPlane plane = new OnPlane();
     if (crv.IsPlanar(plane, tol))
     {
       OnBoundingBox bbox = crv.BoundingBox();
       On3dPoint point = plane.ClosestPointTo(bbox.Center());
       OnMassProperties mp = new OnMassProperties();
       if (crv.AreaMassProperties(point, plane.Normal(), ref mp))
     area = Math.Abs(mp.Area());
     }
       }
       return area;
 }
 private static double GetBrepArea(IOnBrep brep)
 {
     double area = 0.0;
       if (null != brep)
       {
     OnMassProperties mp = new OnMassProperties();
     if (brep.AreaMassProperties(ref mp, true))
       area = Math.Abs(mp.Area());
       }
       return area;
 }