| 57 | } |
| 58 | |
| 59 | inline void |
| 60 | randomPointTriangle (float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3, |
| 61 | float r1, float r2, Eigen::Vector3f& p) |
| 62 | { |
| 63 | float r1sqr = std::sqrt (r1); |
| 64 | float OneMinR1Sqr = (1 - r1sqr); |
| 65 | float OneMinR2 = (1 - r2); |
| 66 | a1 *= OneMinR1Sqr; |
| 67 | a2 *= OneMinR1Sqr; |
| 68 | a3 *= OneMinR1Sqr; |
| 69 | b1 *= OneMinR2; |
| 70 | b2 *= OneMinR2; |
| 71 | b3 *= OneMinR2; |
| 72 | c1 = r1sqr * (r2 * c1 + b1) + a1; |
| 73 | c2 = r1sqr * (r2 * c2 + b2) + a2; |
| 74 | c3 = r1sqr * (r2 * c3 + b3) + a3; |
| 75 | p[0] = c1; |
| 76 | p[1] = c2; |
| 77 | p[2] = c3; |
| 78 | } |
| 79 | |
| 80 | inline void |
| 81 | randPSurface (vtkPolyData * polydata, std::vector<double> * cumulativeAreas, double totalArea, Eigen::Vector3f& p, bool calcNormal, Eigen::Vector3f& n, bool calcColor, Eigen::Vector3f& c) |