bestfit.h
Go to the documentation of this file.
1 #ifndef BEST_FIT_H
2 
3 #define BEST_FIT_H
4 
5 // This routine was released in 'snippet' form
6 // by John W. Ratcliff mailto:jratcliff@infiniplex.net
7 // on March 22, 2006.
8 //
9 // This routine computes the 'best fit' plane equation to
10 // a set of input data points with an optional per vertex
11 // weighting component.
12 //
13 // The implementation for this was lifted directly from
14 // David Eberly's Magic Software implementation.
15 
16 // computes the best fit plane to a collection of data points.
17 // returns the plane equation as A,B,C,D format. (Ax+By+Cz+D)
18 
73 namespace ConvexDecomposition
74 {
75 
76 
77 bool getBestFitPlane(unsigned int vcount, // number of input data points
78  const double *points, // starting address of points array.
79  unsigned int vstride, // stride between input points.
80  const double *weights, // *optional point weighting values.
81  unsigned int wstride, // weight stride for each vertex.
82  double *plane);
83 
84 
85 double getBoundingRegion(unsigned int vcount,const double *points,unsigned int pstride,double *bmin,double *bmax); // returns the diagonal distance
86 bool overlapAABB(const double *bmin1,const double *bmax1,const double *bmin2,const double *bmax2); // return true if the two AABB's overlap.
87 
88 };
89 
90 #endif
ConvexDecomposition
Definition: bestfit.cpp:75
ConvexDecomposition::getBoundingRegion
double getBoundingRegion(unsigned int vcount, const double *points, unsigned int pstride, double *bmin, double *bmax)
Definition: bestfit.cpp:431
ConvexDecomposition::overlapAABB
bool overlapAABB(const double *bmin1, const double *bmax1, const double *bmin2, const double *bmax2)
Definition: bestfit.cpp:469
ConvexDecomposition::getBestFitPlane
bool getBestFitPlane(unsigned int vcount, const double *points, unsigned int vstride, const double *weights, unsigned int wstride, double *plane)
Definition: bestfit.cpp:292


convex_decomposition
Author(s): John W. Ratcliff
autogenerated on Wed Mar 2 2022 00:04:59