Class AbstractConvexHullGenerator2D

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static double DEFAULT_TOLERANCE
      Default value for tolerance.
      private boolean includeCollinearPoints
      Indicates if collinear points on the hull shall be present in the output.
      private double tolerance
      Tolerance below which points are considered identical.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract java.util.Collection<Vector2D> findHullVertices​(java.util.Collection<Vector2D> points)
      Find the convex hull vertices from the set of input points.
      ConvexHull2D generate​(java.util.Collection<Vector2D> points)
      Builds the convex hull from the set of input points.
      double getTolerance()
      Get the tolerance below which points are considered identical.
      boolean isIncludeCollinearPoints()
      Returns if collinear points on the hull will be added as hull vertices.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_TOLERANCE

        private static final double DEFAULT_TOLERANCE
        Default value for tolerance.
        See Also:
        Constant Field Values
      • tolerance

        private final double tolerance
        Tolerance below which points are considered identical.
      • includeCollinearPoints

        private final boolean includeCollinearPoints
        Indicates if collinear points on the hull shall be present in the output. If false, only the extreme points are added to the hull.
    • Constructor Detail

      • AbstractConvexHullGenerator2D

        protected AbstractConvexHullGenerator2D​(boolean includeCollinearPoints)
        Simple constructor.

        The default tolerance (1e-10) will be used to determine identical points.

        Parameters:
        includeCollinearPoints - indicates if collinear points on the hull shall be added as hull vertices
      • AbstractConvexHullGenerator2D

        protected AbstractConvexHullGenerator2D​(boolean includeCollinearPoints,
                                                double tolerance)
        Simple constructor.
        Parameters:
        includeCollinearPoints - indicates if collinear points on the hull shall be added as hull vertices
        tolerance - tolerance below which points are considered identical
    • Method Detail

      • getTolerance

        public double getTolerance()
        Get the tolerance below which points are considered identical.
        Returns:
        the tolerance below which points are considered identical
      • isIncludeCollinearPoints

        public boolean isIncludeCollinearPoints()
        Returns if collinear points on the hull will be added as hull vertices.
        Returns:
        true if collinear points are added as hull vertices, or false if only extreme points are present.
      • findHullVertices

        protected abstract java.util.Collection<Vector2D> findHullVertices​(java.util.Collection<Vector2D> points)
        Find the convex hull vertices from the set of input points.
        Parameters:
        points - the set of input points
        Returns:
        the convex hull vertices in CCW winding