You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Matt Juntunen (Jira)" <ji...@apache.org> on 2019/12/24 22:48:00 UTC

[jira] [Commented] (GEOMETRY-72) Boundary API

    [ https://issues.apache.org/jira/browse/GEOMETRY-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17003009#comment-17003009 ] 

Matt Juntunen commented on GEOMETRY-72:
---------------------------------------

PR is available: [https://github.com/apache/commons-geometry/pull/48]

 

I decided to not implement a {{BoundaryXD}} interface since it seemed unnecessary.

> Boundary API
> ------------
>
>                 Key: GEOMETRY-72
>                 URL: https://issues.apache.org/jira/browse/GEOMETRY-72
>             Project: Apache Commons Geometry
>          Issue Type: New Feature
>          Components: Euclidean 2D, Euclidean 3D
>            Reporter: Matt Juntunen
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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.
> {code:java}
> public interface Boundary3D {
>     // Return a convex subplane representing the same boundary as this instance
>     ConvexSubPlane toSubPlane();
> }
> {code}
> {code:java}
> public interface BoundarySource3D<B extends Boundary3D> {
>     // get a stream of boundary instances
>     Stream<B> boundaryStream();
> }
> {code}
> {code:java}
> // 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());
>         }
>     }
> }
> {code}
> This API would also be used for raycasting (see GEOMETRY-68).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)