BRL-CAD
plane_calc.h File Reference
#include "common.h"
#include "vmath.h"
#include "bn/defines.h"
#include "bn/plane_struct.h"
#include "bn/tol.h"
Include dependency graph for plane_calc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BN_CLASSIFY_UNIMPLEMENTED   0x0000
 
#define BN_CLASSIFY_INSIDE   0x0001
 
#define BN_CLASSIFY_OVERLAPPING   0x0002
 
#define BN_CLASSIFY_OUTSIDE   0x0003
 

Functions

int bn_distsq_line3_line3 (fastf_t dist[3], point_t P, vect_t d, point_t Q, vect_t e, point_t pt1, point_t pt2)
 Plane/line/point calculations. More...
 
int bn_dist_pt3_line3 (fastf_t *dist, point_t pca, const point_t a, const point_t p, const vect_t dir, 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_dist_line3_line3 (fastf_t dist[2], const point_t p1, const point_t p2, const vect_t d1, const vect_t d2, const struct bn_tol *tol)
 
int bn_dist_pt3_lseg3 (fastf_t *dist, point_t pca, const point_t a, const point_t b, const point_t p, const struct bn_tol *tol)
 Find the distance from a point P to a line segment described by the two endpoints A and B, and the point of closest approach (PCA). More...
 
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_3pts_collinear (point_t a, point_t b, point_t c, const struct bn_tol *tol)
 Check to see if three points are collinear. More...
 
int bn_pt3_pt3_equal (const point_t a, const point_t b, const struct bn_tol *tol)
 
int bn_dist_pt2_lseg2 (fastf_t *dist_sq, fastf_t pca[2], const point_t a, const point_t b, const point_t p, const struct bn_tol *tol)
 Find the distance from a point P to a line segment described by the two endpoints A and B, and the point of closest approach (PCA). More...
 
int bn_isect_lseg3_lseg3 (fastf_t *dist, const point_t p, const vect_t pdir, const point_t q, const vect_t qdir, const struct bn_tol *tol)
 Intersect two 3D line segments, defined by two points and two vectors. The vectors are unlikely to be unit length. More...
 
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)
 
int bn_isect_line3_line3 (fastf_t *s, fastf_t *t, const point_t p0, const vect_t u, const point_t q0, const vect_t v, const struct bn_tol *tol)
 
int bn_2line3_colinear (const point_t p1, const vect_t d1, const point_t p2, const vect_t d2, double range, const struct bn_tol *tol)
 Returns non-zero if the 3 lines are collinear to within tol->dist over the given distance range. More...
 
int bn_isect_pt2_lseg2 (fastf_t *dist, const point_t a, const point_t b, const point_t p, const struct bn_tol *tol)
 Intersect a point P with the line segment defined by two distinct points A and B. More...
 
int bn_isect_line2_lseg2 (fastf_t *dist, const point_t p, const vect_t d, const point_t a, const vect_t c, const struct bn_tol *tol)
 Intersect a line in parametric form: More...
 
int bn_isect_lseg2_lseg2 (fastf_t *dist, const point_t p, const vect_t pdir, const point_t q, const vect_t qdir, const struct bn_tol *tol)
 Intersect two 2D line segments, defined by two points and two vectors. The vectors are unlikely to be unit length. More...
 
int bn_isect_line2_line2 (fastf_t *dist, const point_t p, const vect_t d, const point_t a, const vect_t c, const struct bn_tol *tol)
 
double bn_dist_pt3_pt3 (const point_t a, const point_t b)
 Returns distance between two points. More...
 
int bn_3pts_distinct (const point_t a, const point_t b, const point_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 (plane_t plane, const point_t a, const point_t b, const point_t c, const struct bn_tol *tol)
 
int bn_mkpoint_3planes (point_t pt, const plane_t a, const plane_t b, const plane_t c)
 Given the description of three planes, compute the point of intersection, if any. The direction vectors of the planes need not be of unit length. More...
 
int bn_isect_line3_plane (fastf_t *dist, const point_t pt, const vect_t dir, const plane_t plane, const struct bn_tol *tol)
 
int bn_isect_2planes (point_t pt, vect_t dir, const plane_t a, const plane_t b, const vect_t rpp_min, const struct bn_tol *tol)
 Given two planes, find the line of intersection between them, if one exists. The line of intersection is returned in parametric line (point & direction vector) form. More...
 
int bn_isect_2lines (fastf_t *t, fastf_t *u, const point_t p, const vect_t d, const point_t a, const vect_t c, const struct bn_tol *tol)
 
int bn_isect_line_lseg (fastf_t *t, const point_t p, const vect_t d, const point_t a, const point_t b, const struct bn_tol *tol)
 Intersect a line in parametric form: More...
 
double bn_dist_line3_pt3 (const point_t pt, const vect_t dir, const point_t a)
 
double bn_distsq_line3_pt3 (const point_t pt, const vect_t dir, const point_t a)
 
double bn_dist_line_origin (const point_t pt, const vect_t dir)
 Given a parametric line defined by PT + t * DIR, return the closest distance between the line and the origin. More...
 
double bn_dist_line2_point2 (const point_t pt, const vect_t dir, const point_t a)
 Given a parametric line defined by PT + t * DIR and a point A, return the closest distance between the line and the point. More...
 
double bn_distsq_line2_point2 (const point_t pt, const vect_t dir, const point_t a)
 Given a parametric line defined by PT + t * DIR and a point A, return the closest distance between the line and the point, squared. More...
 
double bn_area_of_triangle (const point_t a, const point_t b, const point_t c)
 Returns the area of a triangle. Algorithm by Jon Leech 3/24/89. More...
 
int bn_isect_pt_lseg (fastf_t *dist, const point_t a, const point_t b, const point_t p, const struct bn_tol *tol)
 Intersect a point P with the line segment defined by two distinct points A and B. More...
 
double bn_dist_pt_lseg (point_t pca, const point_t a, const point_t b, const point_t p, const struct bn_tol *tol)
 
void bn_rotate_bbox (point_t omin, point_t omax, const mat_t mat, const point_t imin, const point_t imax)
 Transform a bounding box (RPP) by the given 4x4 matrix. There are 8 corners to the bounding RPP. Each one needs to be transformed and min/max'ed. This is not minimal, but does fully contain any internal object, using an axis-aligned RPP. More...
 
void bn_rotate_plane (plane_t oplane, const mat_t mat, const plane_t iplane)
 Transform a plane equation by the given 4x4 matrix. More...
 
int bn_coplanar (const plane_t a, const plane_t b, const struct bn_tol *tol)
 Test if two planes are identical. If so, their dot products will be either +1 or -1, with the distance from the origin equal in magnitude. More...
 
double bn_angle_measure (vect_t vec, const vect_t x_dir, const vect_t y_dir)
 
double bn_dist_pt3_along_line3 (const point_t p, const vect_t d, const point_t x)
 Return the parametric distance t of a point X along a line defined as a ray, i.e. solve X = P + t * D. If the point X does not lie on the line, then t is the distance of the perpendicular projection of point X onto the line. More...
 
double bn_dist_pt2_along_line2 (const point_t p, const vect_t d, const point_t x)
 Return the parametric distance t of a point X along a line defined as a ray, i.e. solve X = P + t * D. If the point X does not lie on the line, then t is the distance of the perpendicular projection of point X onto the line. More...
 
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 plane_t half_eqn, const vect_t min, const vect_t max, const struct bn_tol *tol)
 Classify a halfspace, specified by its plane equation, against a bounding RPP. More...
 
int bn_isect_planes (point_t pt, const plane_t planes[], const size_t pl_count)
 Calculates the point that is the minimum distance from all the planes in the "planes" array. If the planes intersect at a single point, that point is the solution. More...