예제 #1
0
        /// <summary>
        /// calculates volume, only works on an amorphus blob. Returns a double in real world space.
        /// </summary>
        /// <param name="planes">List(List(Point3D))</param>
        /// <param name="increment">double</param>
        /// <returns>double</returns>
        public static double volume1stApprox(List <List <Point3D> > planes, double increment)
        {
            double volume = 0;

            for (int i = 0; i < planes.Count; i++)
            {
                List <Point3D> plane = planes[i];
                if (plane.Count != 0)
                {
                    plane.Add(plane[0]); //a list eating its own head, steve matthews would be proud

                    double area = 0;

                    area = AreaCalculator.calculateArea(plane);

                    volume = volume + (area * increment);
                }
                else
                {
                    Console.WriteLine("Plane EMPTY!!! BAD THINGS WILL HAPPEN");
                }
            }
            volume = UnitConvertor.convertPCM(volume, 3);
            return(volume);
        }
예제 #2
0
        /// <summary>
        /// returns one area for every plane fed. returns real world areas not point cloud areas
        /// </summary>
        /// <param name="planes">List(List(Point3D))</param>
        /// <returns>List(double)</returns>
        public static List <double> getAllAreas(List <List <Point3D> > planes)
        {
            List <double> output = new List <double>();

            for (int i = 0; i < planes.Count; i++)
            {
                output.Add(UnitConvertor.convertPCM(AreaCalculator.calculateArea(planes[i]), 2));
            }
            return(output);
        }