Interface HyperplaneSubset<P extends Point<P>>

Type Parameters:
P - Point implementation type
All Superinterfaces:
Sized, Splittable<P,HyperplaneSubset<P>>
All Known Subinterfaces:
ConvexPolygon3D, HyperplaneConvexSubset<P>, PlaneConvexSubset, PlaneSubset, Triangle3D
All Known Implementing Classes:
AbstractConvexPolygon3D, AbstractEmbeddedRegionPlaneSubset, AbstractPlaneSubset, CutAngle.CutAngleConvexSubset, EmbeddedAreaPlaneConvexSubset, EmbeddedTreeGreatCircleSubset, EmbeddedTreeLineSubset, EmbeddedTreePlaneSubset, GreatArc, GreatCircleSubset, LineConvexSubset, LineSpanningSubset, LineSubset, OrientedPoint.OrientedPointConvexSubset, Ray, ReverseRay, Segment, SimpleTriangle3D, VertexListConvexPolygon3D

public interface HyperplaneSubset<P extends Point<P>> extends Splittable<P,HyperplaneSubset<P>>, Sized
Interface representing a subset of the points lying in a hyperplane. Examples include rays and line segments in Euclidean 2D space and triangular facets in Euclidean 3D space. Hyperplane subsets can have finite or infinite size and can represent contiguous regions of the hyperplane (as in the examples above); multiple, disjoint regions; or the entire hyperplane.

This interface is very similar to the Region interface but has slightly different semantics. Whereas Region instances represent sets of points that can expand through all of the dimensions of a space, HyperplaneSubset instances are constrained to their containing hyperplane and are more accurately defined as Regions of the n-1 dimension subspace defined by the hyperplane. This makes the methods of this interface have slightly different meanings as compared to their Region counterparts. For example, consider a triangular facet in Euclidean 3D space. The Sized.getSize() method of this hyperplane subset does not return the volume of the instance (which would be 0) as a regular 3D region would, but rather returns the area of the 2D polygon defined by the facet. Similarly, the classify(Point) method returns RegionLocation.INSIDE for points that lie inside of the 2D polygon defined by the facet, instead of the RegionLocation.BOUNDARY value that would be expected if the facet was considered as a true 3D region with zero thickness.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    classify(P pt)
    Classify a point with respect to the subset region.
    closest(P pt)
    Return the closest point to the argument that is contained in the subset (ie, not classified as outside), or null if no such point exists.
    default boolean
    contains(P pt)
    Return true if the hyperplane subset contains the given point, meaning that the point lies on the hyperplane and is not on the outside of the subset region.
    Get the centroid, or geometric center, of the hyperplane subset or null if no centroid exists or one exists but is not unique.
    Get the hyperplane containing this instance.
    boolean
    Return true if this instance does not contain any points.
    boolean
    Return true if this instance contains all points in the hyperplane.
    Convert this instance into a list of convex child subsets representing the same region.
    transform(Transform<P> transform)
    Return a new hyperplane subset resulting from the application of the given transform.

    Methods inherited from interface org.apache.commons.geometry.core.Sized

    getSize, isFinite, isInfinite

    Methods inherited from interface org.apache.commons.geometry.core.partitioning.Splittable

    split
  • Method Details

    • getHyperplane

      Hyperplane<P> getHyperplane()
      Get the hyperplane containing this instance.
      Returns:
      the hyperplane containing this instance
    • isFull

      boolean isFull()
      Return true if this instance contains all points in the hyperplane.
      Returns:
      true if this instance contains all points in the hyperplane
    • isEmpty

      boolean isEmpty()
      Return true if this instance does not contain any points.
      Returns:
      true if this instance does not contain any points
    • getCentroid

      P getCentroid()
      Get the centroid, or geometric center, of the hyperplane subset or null if no centroid exists or one exists but is not unique. A centroid will not exist for empty or infinite subsets.

      The centroid of a geometric object is defined as the mean position of all points in the object, including interior points, vertices, and other points lying on the boundary. If a physical object has a uniform density, then its center of mass is the same as its geometric centroid.

      Returns:
      the centroid of the hyperplane subset or null if no unique centroid exists
      See Also:
    • classify

      RegionLocation classify(P pt)
      Classify a point with respect to the subset region. The point is classified as follows:
      • INSIDE - The point lies on the hyperplane and inside of the subset region.
      • BOUNDARY - The point lies on the hyperplane and is on the boundary of the subset region.
      • OUTSIDE - The point does not lie on the hyperplane or it does lie on the hyperplane but is outside of the subset region.
      Parameters:
      pt - the point to classify
      Returns:
      classification of the point with respect to the hyperplane and subspace region
    • contains

      default boolean contains(P pt)
      Return true if the hyperplane subset contains the given point, meaning that the point lies on the hyperplane and is not on the outside of the subset region.
      Parameters:
      pt - the point to check
      Returns:
      true if the point is contained in the hyperplane subset
    • closest

      P closest(P pt)
      Return the closest point to the argument that is contained in the subset (ie, not classified as outside), or null if no such point exists.
      Parameters:
      pt - the reference point
      Returns:
      the closest point to the reference point that is contained in the subset, or null if no such point exists
    • transform

      HyperplaneSubset<P> transform(Transform<P> transform)
      Return a new hyperplane subset resulting from the application of the given transform. The current instance is not modified.
      Parameters:
      transform - the transform instance to apply
      Returns:
      new transformed hyperplane subset
    • toConvex

      List<? extends HyperplaneConvexSubset<P>> toConvex()
      Convert this instance into a list of convex child subsets representing the same region. Implementations are not required to return an optimal convex subdivision of the current instance. They are free to return whatever subdivision is readily available.
      Returns:
      a list of hyperplane convex subsets representing the same subspace region as this instance