Class EmbeddedAreaPlaneConvexSubset

    • Field Detail

      • area

        private final ConvexArea area
        The embedded 2D area.
    • Constructor Detail

      • EmbeddedAreaPlaneConvexSubset

        EmbeddedAreaPlaneConvexSubset​(EmbeddingPlane plane,
                                      ConvexArea area)
        Create a new instance from its component parts.
        Parameters:
        plane - plane the the convex area is embedded in
        area - the embedded convex area
    • Method Detail

      • getVertices

        public java.util.List<Vector3D> getVertices()
        Get the vertices for the convex subset in a counter-clockwise order as viewed looking down the plane normal. Each vertex in the returned list is unique. If the boundary of the subset is closed, the start vertex is not repeated at the end of the list.

        It is important to note that, in general, the list of vertices returned by this method is not sufficient to completely characterize the subset. For example, a simple triangle has 3 vertices, but an infinite area constructed from two parallel lines and two lines that intersect between them will also have 3 vertices. It is also possible for non-empty subsets to contain no vertices at all. For example, a subset with no boundaries (representing the full plane), a subset with a single boundary (ie, a half-plane), or a subset with two parallel boundaries will not contain any vertices.

        Specified by:
        getVertices in interface PlaneConvexSubset
        Returns:
        the list of vertices for the plane convex subset in a counter-clockwise order as viewed looking down the plane normal
      • getBounds

        public Bounds3D getBounds()
        Get a Bounds3D object defining an axis-aligned bounding box containing all vertices for this subset. Null is returned if the subset is infinite or does not contain any vertices.
        Specified by:
        getBounds in interface PlaneSubset
        Returns:
        the bounding box for this instance or null if no valid bounds could be determined
      • toTriangles

        public java.util.List<Triangle3D> toTriangles()
        Return a list of triangles representing the same subset region as this instance. An IllegalStateException is thrown if the subset has infinite size and therefore cannot be converted to triangles. If the subset has zero size (is empty), an empty list is returned.
        Specified by:
        toTriangles in interface PlaneSubset
        Returns:
        a list of triangles representing the same subset region as this instance
      • reverse

        public EmbeddedAreaPlaneConvexSubset reverse()
        Reverse the orientation of the hyperplane for this instance, returning the result as a new instance. The returned subset contains the same points but has a reversed orientation.
        Specified by:
        reverse in interface HyperplaneConvexSubset<Vector3D>
        Specified by:
        reverse in interface PlaneConvexSubset
        Returns:
        a hyperplane convex subset representing the same region but with the opposite orientation.