Interface Shape3D

All Known Subinterfaces:
Model3DOps<T>, SurfaceOps
All Known Implementing Classes:
BezierCap, BezierGrid, BezierVertex, ConvexPathConnector, Model3D, Rectangle3D, Rectangle3D.Double, Rectangle3D.Float, SteppedGrid, Surface3D, Surface3D.Double, Surface3D.Float

public interface Shape3D
Interface representing a two-dimensional shape - a surface embedded in a three-dimensional space.

This interface provides the common operations for all surfaces. These include

  • getting a bounding box (a rectangular cuboid whose edges are parallel to the X, Y, and Z axes.
  • getting ta surface iterator that will allow points on the surface to be computed.
  • testing if the surface has an orientation or not.
  • testing if the surface is a closed manifold.
  • getting a surface iterator that will describe the surface as a sequence of planar triangles, cubic Bézier triangles, and cubic Bézier patches.
  • getting the boundary of the surface. Null will be returned if the surface is not a manifold) and the boundary cannot be determined by some other means. If the surface is a closed two-dimensional manifold, an empty path will be returned.
  • Method Details

    • getBounds

      Rectangle3D getBounds()
      Get a bounding rectangular cuboid for a 3D shape. The edges will be aligned with the X, Y and Z axes. The cuboid created may not be the smallest one possible (for example, shapes defined by Bézier surfaces may just use the control points to determine the cuboid as the convex hull for the control points includes all of the surface for parameters in the normal range [0,1]).
      Returns:
      a bounding rectangular cuboid for this Shape3D; null if the shape does not contain any points
    • getSurfaceIterator

      SurfaceIterator getSurfaceIterator(Transform3D tform)
      Get a surface iterator for this Shape3D. The surface iterator will represent the shape as a sequence of Bézier patches and Bézier triangles, with the order of the sequence arbitrary.

      Unless the transform is an affine transform, the transformation is not exact. In this case, the patches and triangles that constitute the surface should be small enough that the transform can be approximated by an affine transform over the region containing the control points.

      Parameters:
      tform - a transform to apply to each control point; null for the identity transform
      Returns:
      a surface iterator
    • getSurfaceIterator

      SurfaceIterator getSurfaceIterator(Transform3D tform, int level)
      Get a surface iterator for this Shape3D, subdividing the surface. The surface iterator will represent the shape as a sequence of Bézier patches and Bézier triangles, with the order of the sequence arbitrary.

      Unless the transform is an affine transform, the transformation is not exact. In this case, the patches and triangles that constitute the surface after each is subdivided should be small enough that the transform can be approximated by an affine transform over the region containing the control points.

      Parameters:
      tform - a transform to apply to each control point; null for the identity transform
      level - the number of levels of partitioning (each additional level splits the previous level into quarters)
      Returns:
      a surface iterator
    • isOriented

      boolean isOriented()
      Determine if a surface is oriented.
      Returns:
      true if the surface has an orientation; false if it does not
    • getBoundary

      Path3D getBoundary()
      Get the boundary for this Shape3D. For a closed surface, the boundary will be an empty path.

      Typically, a boundary will consist of a series of distinct closed subpaths. Subpaths are separated by segments whose type is {link PathIterator3D#SEG_MOVETO}. For a closed manifold, the boundary will be an empty path.

      Returns:
      the boundary of this surface; null if a boundary cannot be computed
      See Also:
    • getBoundary

      default Path3D getBoundary(Point3D neighbor, BiPredicate<Integer,double[]> filter, boolean all)
      Get a boundary component given constraints. The method getBoundary() may return a path consisting of multiple disjoint subpaths, each typically a closed path. This method tests selected control points from each subpath and returns tha path for which one of these control points is the one closest to a neighbor specified by the first argument. The control points selected are chosen as follows:
      • if last argument (all) is true, all control points are considered and if false, intermediate control points along each path segment are ignored.
      • if the filter argument is not null, its "test" method is called and only those control points where this method returns true are considered. The "test" method takes two argument:
        • the first argument is an offset into the array passed as the second argument
        • the second argument is an array of control-point coordinates in groups of three, with each group containing the X coordinate followed by the Y coordinate followed by the Z coordinate.
      • if the nieghbor is null, an arbitrary subpath with at least onc control point for which the filter returned true will be returned.
      • if the filter and neighbor are both null, an arbitrary subpath will be returned.
      Parameters:
      neighbor - the test point; null if just the filter should be used
      filter - the control-point filter; null for no filtering
      all - true if all control points should be considered before filtering; false if intermediate control points should be skipped
      Returns:
      the boundary; null if a boundary could not be computed or if no boundary matches the constraints.
    • isClosedManifold

      boolean isClosedManifold()
      Determine if this Shape3D is a closed two-dimensional manifold.
      Returns:
      true if the surface is a closed two-dimensional manifold; false otherwise
    • numberOfComponents

      int numberOfComponents()
      Get the number of components for this shape. Components are connected shapes - surfaces for which every point can connect to any other point.
      Returns:
      the number of components for this shape
      Throws:
      IllegalStateException - the surface is ill-formed and its components (the components of a 2-manifold) cannot be computed.
    • getComponent

      Get a component of this shape. Components are connected shapes - surfaces for which every point can connect to any other point. The components are referenced by an index, specified as an integer in the range [0,n), where n is the number of manifold components. If n is zero, no index is valid.
      Parameters:
      i - the component's index
      Returns:
      a model containing the specified component
      Throws:
      IllegalArgumentException - the argument is out of range
      IllegalStateException - the shape is ill-formed and its components cannot be computed.
      See Also: