Oriented Bounding Rectangles/Rectangular Cuboids
Collaboration diagram for Oriented Bounding Rectangles/Rectangular Cuboids:


This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.

## Functions

int bn_2d_obr (point2d_t *center, vect2d_t *u, vect2d_t *v, const point2d_t *points_2d, int pnt_cnt)
Routines for the computation of oriented bounding rectangles 2D and 3D. More...

int bn_3d_coplanar_obr (point_t *center, vect_t *v1, vect_t *v2, const point_t *points_3d, int pnt_cnt)
Uses the Rotating Calipers algorithm to find the minimum oriented bounding rectangle for a set of coplanar 3D points. Returns 0 on success. More...

## Function Documentation

 int bn_2d_obr ( point2d_t * center, vect2d_t * u, vect2d_t * v, const point2d_t * points_2d, int pnt_cnt )

Routines for the computation of oriented bounding rectangles 2D and 3D.

Uses the Rotating Calipers algorithm to find the minimum oriented bounding rectangle for a set of 2D points. Returns 0 on success.

The box will be described by a center point and 2 vectors:

```* ----------------------------
* |            ^             |
* |            |             |
* |         v  |             |
* |            |             |
* |            *------------>|
* |         center     u     |
* |                          |
* |                          |
* ----------------------------
* ```

Note that the box is oriented, and thus not necessarily axis aligned (u and v are perpendicular, but not necessarily parallel with the coordinate space V=0 and U=0 axis vectors.)

Parameters
 [out] center center of oriented bounding rectangle [out] u vector in the direction of obr x with vector length of 0.5 * obr length [out] v vector in the obr y direction with vector length of 0.5 * obr width points_2d array of 2D points pnt_cnt number of points in pnts array

Definition at line 470 of file obr.c.

Referenced by bn_3d_coplanar_obr(), and main().

Here is the call graph for this function:

 int bn_3d_coplanar_obr ( point_t * center, vect_t * v1, vect_t * v2, const point_t * points_3d, int pnt_cnt )

Uses the Rotating Calipers algorithm to find the minimum oriented bounding rectangle for a set of coplanar 3D points. Returns 0 on success.

Parameters
 [out] center center of oriented bounding rectangle [out] v1 vector in the direction of obr x with vector length of 0.5 * obr length [out] v2 vector in the obr y direction with vector length of 0.5 * obr width points_3d array of coplanar 3D points pnt_cnt number of points in pnts array

Definition at line 496 of file obr.c.

Referenced by main(), and nmg_brep_face().

Here is the call graph for this function: