Class EmbeddedTreeLineSubset3D

java.lang.Object
org.apache.commons.geometry.euclidean.threed.line.LineSubset3D
org.apache.commons.geometry.euclidean.threed.line.EmbeddedTreeLineSubset3D
All Implemented Interfaces:
Embedding<Vector3D,Vector1D>, RegionEmbedding<Vector3D,Vector1D>, Sized

public final class EmbeddedTreeLineSubset3D extends LineSubset3D
Class representing an arbitrary subset of a line in 3D Euclidean space using a RegionBSPTree1D. This class can represent convex, non-convex, finite, infinite, and empty regions.

This class is mutable and not thread safe.

  • Field Details

    • region

      private final RegionBSPTree1D region
      The 1D region representing the area on the line.
  • Constructor Details

    • EmbeddedTreeLineSubset3D

      public EmbeddedTreeLineSubset3D(Line3D line)
      Construct a new, empty subset for the given line.
      Parameters:
      line - line defining the subset
    • EmbeddedTreeLineSubset3D

      public EmbeddedTreeLineSubset3D(Line3D line, boolean full)
      Construct a new subset for the given line. If full is true, then the subset will cover the entire line; otherwise, it will be empty.
      Parameters:
      line - line defining the subset
      full - if true, the subset will cover the entire space; otherwise it will be empty
    • EmbeddedTreeLineSubset3D

      public EmbeddedTreeLineSubset3D(Line3D line, RegionBSPTree1D region)
      Construct a new instance from its defining line and subspace region.
      Parameters:
      line - line defining the subset
      region - subspace region for the subset
  • Method Details

    • getSize

      public double getSize()
      Get the size of the instance.
      Returns:
      the size of the instance
    • getSubspaceRegion

      public RegionBSPTree1D getSubspaceRegion()
      Get the subspace region for the instance.
      Specified by:
      getSubspaceRegion in interface RegionEmbedding<Vector3D,Vector1D>
      Specified by:
      getSubspaceRegion in class LineSubset3D
      Returns:
      the subspace region for the instance
    • getCentroid

      public Vector3D getCentroid()
      Get the centroid, or geometric center, of the line subset or null if the subset is empty or infinite.
      Specified by:
      getCentroid in class LineSubset3D
      Returns:
      the centroid of the line subset, or null if the subset is empty or infinite
    • getBounds

      public Bounds3D getBounds()
      Get the 3D bounding box of the line subset or null if the subset is empty or infinite.
      Specified by:
      getBounds in class LineSubset3D
      Returns:
      the 3D bounding box the line subset or null if the subset is empty or infinite
    • transform

      public EmbeddedTreeLineSubset3D transform(Transform<Vector3D> transform)
      Transform this instance.
      Parameters:
      transform - the transform to apply
      Returns:
      a new, transformed instance
    • toConvex

      public List<LineConvexSubset3D> toConvex()
      Return a list of LineConvexSubset3D instances representing the same region as this instance.
      Returns:
      a list of LineConvexSubset3D instances representing the same region as this instance.
    • toString

      public String toString()
      Overrides:
      toString in class Object