/** *
* Interface for boundaries environments for robots. * This interface is going to cause a problem, as * the methods for storing polygons vs. polyhedra are * fundamentally different. * A core set of queries can be made which work for any number of dimensions, * but some sensors may want access to winged edge representations for 2d * or "graph of polygons" representations for 3d boundaries. * Also some boundaries may be curved surfaces rather then polytopes. * This may be handled by casting to a subtype for 2d boundaries * and not worrying about higher dimensionalities, as * correct implementation of complex non-convex polyhedral boundaries * in 3d is extremely difficult. *
* @author Michael Schuresko * @version %I%, %G% * @since 1.0 */ public interface IBoundary { /** * Mostly just a safety check, since the environment should have * this anyway */ public int getNumDimensions(); /** * Inside / outside query. */ public boolean isPointInside(double arrPoint[]); /** * Finds distance to boundary along a ray from a start point, * returns negative number if outside boundary * @param arrRayOrigin origin of ray * @param arrRayDir direction of ray * @return distance along arrRayDir from arrRayOrigin to boundary, negative if arrRayOrigin is outside boundary */ public double distToBoundary(double arrRayOrigin[], double arrRayDir[]); /** * Finds the closest point on the boundary to a given point, * or a minimally close point if multiple such points exist. * @param arrPoint point to find closest point to * @return closest point to arrPoint */ public double [] closestBoundaryPoint(double arrPoint[]); /** * gets bounding box min corner * @return min corner of bounding box */ public double [] bboxMinCorner(); /** * gets bounding box max corner * @return max corner of bounding box */ public double [] bboxMaxCorner(); }