Class Normal


  • public class Normal
    extends Object
    • Constructor Detail

      • Normal

        public Normal()
    • Method Detail

      • compute

        public static Coord3d compute​(Coord3d p0,
                                      Coord3d p1,
                                      Coord3d p2)
        Compute the normal for the three points which is a vector perpendicular to the plane formed by the three input points.
      • compute

        public static Coord3d compute​(Coord3d p0,
                                      Coord3d p1,
                                      Coord3d p2,
                                      boolean normalize)
        Compute the normal for the three points which is a vector perpendicular to the plane formed by the three input points.
        Parameters:
        normalize - if true, will divise normal components by the length of the normal
      • compute

        public static Coord3d compute​(List<Point> points,
                                      boolean normalize,
                                      boolean averageNormals)
        Compute the normal for the input list of points.
        Parameters:
        points -
        normalize - if true, will divise normal components by the length of the normal
        averageNormals - if true and if points.size() > 3, will compute a normal for each triangle and then process an average normal of all triangles. If false, simply process normal out of the three first points, hence assuming coplanarity of the points.
        Returns: