XMLWordPrintableJSON

    Details

      Description

      Geometric models are often specified as a set of boundaries. These boundaries may also contain additional data beyond pure geometric information, such as an identifier, color, reflectance, etc. In order to allow these additional properties to be used by commons-geometry, we should make a general interface for region boundaries in Euclidean 2D and 3D. Users could then have their own classes implement this interface and take advantage of commons-geometry algorithms.

      Here is part of the proposed API for 3D. A similar one would exist for 2D.

      public interface Boundary3D {
          // Return a convex subplane representing the same boundary as this instance
          ConvexSubPlane toSubPlane();
      }
      
      public interface BoundarySource3D<B extends Boundary3D> {
          // get a stream of boundary instances
          Stream<B> boundaryStream();
      }
      
      // add additional methods to RegionBSPTree3D
      public class RegionBSPTree3D {
          // insert a boundary stream into the tree
          public <B extends Boundary3D> void insert(BoundarySource3D<B> src) {
              try (Stream<B> stream = src.boundaryStream()) {
                  stream.forEach(b -> insert(b.toSubPlane());
              }
          }
      }
      

      This API would also be used for raycasting (see GEOMETRY-68).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mattjuntunen Matt Juntunen
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h