BRL-CAD

Some useful routines for dealing with planes and lines. More...

#include "common.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include "bu/debug.h"
#include "bu/log.h"
#include "vmath.h"
#include "bn/mat.h"
#include "bn/plane_struct.h"
#include "bn/plane_calc.h"
#include "bn/tol.h"
Include dependency graph for plane.c:

Go to the source code of this file.

Macros

#define UNIT_SQ_TOL   1.0e-13
 
#define DETERMINANT_TOL   1.0e-14 /* XXX caution on non-IEEE machines */
 
#define ROT_VERT(a, b, c)
 
#define CHECK_PT(x, y, z)
 

Functions

double bn_dist_pt3_pt3 (const fastf_t *a, const fastf_t *b)
 
int bn_pt3_pt3_equal (const fastf_t *a, const fastf_t *b, const struct bn_tol *tol)
 
int bn_pt2_pt2_equal (const fastf_t *a, const fastf_t *b, const struct bn_tol *tol)
 
int bn_3pts_collinear (fastf_t *a, fastf_t *b, fastf_t *c, const struct bn_tol *tol)
 
int bn_3pts_distinct (const fastf_t *a, const fastf_t *b, const fastf_t *c, const struct bn_tol *tol)
 
int bn_npts_distinct (const int npts, const point_t *pts, const struct bn_tol *tol)
 
int bn_mk_plane_3pts (fastf_t *plane, const fastf_t *a, const fastf_t *b, const fastf_t *c, const struct bn_tol *tol)
 
int bn_mkpoint_3planes (fastf_t *pt, const fastf_t *a, const fastf_t *b, const fastf_t *c)
 
int bn_2line3_colinear (const fastf_t *p1, const fastf_t *d1, const fastf_t *p2, const fastf_t *d2, double range, const struct bn_tol *tol)
 
int bn_dist_pt3_line3 (fastf_t *dist, fastf_t *pca, const fastf_t *a, const fastf_t *dir, const fastf_t *p, const struct bn_tol *tol)
 
int bn_dist_line3_line3 (fastf_t *dist, const fastf_t *p1, const fastf_t *d1, const fastf_t *p2, const fastf_t *d2, const struct bn_tol *tol)
 
int bn_dist_line3_lseg3 (fastf_t *dist, const fastf_t *p, const fastf_t *d, const fastf_t *a, const fastf_t *b, const struct bn_tol *tol)
 
int bn_isect_line3_plane (fastf_t *dist, const fastf_t *pt, const fastf_t *dir, const fastf_t *plane, const struct bn_tol *tol)
 
int bn_isect_2planes (fastf_t *pt, fastf_t *dir, const fastf_t *a, const fastf_t *b, const fastf_t *rpp_min, const struct bn_tol *tol)
 
int bn_isect_line2_line2 (fastf_t *dist, const fastf_t *p, const fastf_t *d, const fastf_t *a, const fastf_t *c, const struct bn_tol *tol)
 
int bn_isect_line2_lseg2 (fastf_t *dist, const fastf_t *p, const fastf_t *d, const fastf_t *a, const fastf_t *c, const struct bn_tol *tol)
 
int bn_isect_lseg2_lseg2 (fastf_t *dist, const fastf_t *p, const fastf_t *pdir, const fastf_t *q, const fastf_t *qdir, const struct bn_tol *tol)
 
int bn_isect_lseg3_lseg3 (fastf_t *dist, const fastf_t *p, const fastf_t *pdir, const fastf_t *q, const fastf_t *qdir, const struct bn_tol *tol)
 
int bn_isect_line3_line3 (fastf_t *pdist, fastf_t *qdist, const fastf_t *p0, const fastf_t *pdir_i, const fastf_t *q0, const fastf_t *qdir_i, const struct bn_tol *tol)
 
int bn_isect_line_lseg (fastf_t *t, const fastf_t *p, const fastf_t *d, const fastf_t *a, const fastf_t *b, const struct bn_tol *tol)
 
double bn_dist_line3_pt3 (const fastf_t *pt, const fastf_t *dir, const fastf_t *a)
 
double bn_distsq_line3_pt3 (const fastf_t *pt, const fastf_t *dir, const fastf_t *a)
 
double bn_dist_line_origin (const fastf_t *pt, const fastf_t *dir)
 
double bn_dist_line2_point2 (const fastf_t *pt, const fastf_t *dir, const fastf_t *a)
 
double bn_distsq_line2_point2 (const fastf_t *pt, const fastf_t *dir, const fastf_t *a)
 
double bn_area_of_triangle (register const fastf_t *a, register const fastf_t *b, register const fastf_t *c)
 
int bn_isect_pt_lseg (fastf_t *dist, const fastf_t *a, const fastf_t *b, const fastf_t *p, const struct bn_tol *tol)
 
int bn_isect_pt2_lseg2 (fastf_t *dist, const fastf_t *a, const fastf_t *b, const fastf_t *p, const struct bn_tol *tol)
 
HIDDEN int are_equal (fastf_t a_in, fastf_t b_in, fastf_t t)
 
int bn_distsq_pt3_lseg3_v2 (fastf_t *distsq, const fastf_t *a, const fastf_t *b, const fastf_t *p, const struct bn_tol *tol)
 
int bn_dist_pt3_lseg3 (fastf_t *dist, fastf_t *pca, const fastf_t *a, const fastf_t *b, const fastf_t *p, const struct bn_tol *tol)
 
int bn_dist_pt2_lseg2 (fastf_t *dist_sq, fastf_t *pca, const fastf_t *a, const fastf_t *b, const fastf_t *p, const struct bn_tol *tol)
 
void bn_rotate_bbox (fastf_t *omin, fastf_t *omax, const fastf_t *mat, const fastf_t *imin, const fastf_t *imax)
 
void bn_rotate_plane (fastf_t *oplane, const fastf_t *mat, const fastf_t *iplane)
 
int bn_coplanar (const fastf_t *a, const fastf_t *b, const struct bn_tol *tol)
 
double bn_angle_measure (fastf_t *vec, const fastf_t *x_dir, const fastf_t *y_dir)
 
double bn_dist_pt3_along_line3 (const fastf_t *p, const fastf_t *d, const fastf_t *x)
 
double bn_dist_pt2_along_line2 (const fastf_t *p, const fastf_t *d, const fastf_t *x)
 
int bn_between (double left, double mid, double right, const struct bn_tol *tol)
 
int bn_does_ray_isect_tri (const point_t pt, const vect_t dir, const point_t V, const point_t A, const point_t B, point_t inter)
 
int bn_hlf_class (const fastf_t *half_eqn, const fastf_t *min, const fastf_t *max, const struct bn_tol *tol)
 
int bn_distsq_line3_line3 (fastf_t *dist, fastf_t *P, fastf_t *d_in, fastf_t *Q, fastf_t *e_in, fastf_t *pt1, fastf_t *pt2)
 
int bn_isect_planes (fastf_t *pt, const fastf_t(*planes)[4], const size_t pl_count)
 
int bn_isect_lseg_rpp (fastf_t *a, fastf_t *b, register fastf_t *min, register fastf_t *max)
 
int bn_lseg3_lseg3_parallel (const point_t sg1pt1, const point_t sg1pt2, const point_t sg2pt1, const point_t sg2pt2, const struct bn_tol *tol)
 

Detailed Description

Some useful routines for dealing with planes and lines.

Definition in file plane.c.

Macro Definition Documentation

#define DETERMINANT_TOL   1.0e-14 /* XXX caution on non-IEEE machines */

Referenced by bn_isect_line2_line2().

#define ROT_VERT (   a,
  b,
 
)
Value:
{ \
VSET(local, a[X], b[Y], c[Z]); \
MAT4X3PNT(model, mat, local); \
VMINMAX(omin, omax, model); \
}
#define VSET(a, b, c, d)
Definition: color.c:53
Definition: color.c:49
Definition: color.c:51
Definition: color.c:50

Referenced by bn_rotate_bbox().

#define CHECK_PT (   x,
  y,
 
)
Value:
d = (x)*half_eqn[0] + (y)*half_eqn[1] + (z)*half_eqn[2] - half_eqn[3]; \
if (d < -tol->dist) { \
if (current_classification == BN_CLASSIFY_OUTSIDE) \
else current_classification = BN_CLASSIFY_INSIDE; \
} else if (d > tol->dist) { \
if (current_classification == BN_CLASSIFY_INSIDE) \
else current_classification = BN_CLASSIFY_OUTSIDE; \
#define BN_CLASSIFY_OUTSIDE
Definition: plane_calc.h:1031
#define BN_CLASSIFY_OVERLAPPING
Definition: plane_calc.h:1030
if(share_geom)
Definition: nmg_mod.c:3829
else
Definition: nmg_mod.c:3872
#define BN_CLASSIFY_INSIDE
Definition: plane_calc.h:1029

Referenced by bn_hlf_class().