@ Pure public static Point3d computeClosestPoint ( double minx , double miny , double minz , double maxx , double maxy , double maxz , double x , double y , double z ) { Point3d closest = new Point3d ( ) ; if ( x < minx ) { closest . setX ( minx ) ; } else if ( x > maxx ) { closest . setX ( maxx ) ; } else { closest . setX ( x ) ; } if ( y < miny ) { closest . setY ( miny ) ; } else if ( y > maxy ) { closest . setY ( maxy ) ; } else { closest . setY ( y ) ; } if ( z < minz ) { closest . setZ ( minz ) ; } else if ( z > maxz ) { closest . setZ ( maxz ) ; } else { closest . setZ ( z ) ; } return closest ; }
Replies the point on the shape that is closest to the given point .