48 using Scalar = double;
49 using Vec3 = bvh::Vec<Scalar, 3>;
50 using BBox = bvh::BBox<Scalar, 3>;
51 using Tri = bvh::Tri<Scalar, 3>;
52 using Node = bvh::Node<Scalar, 3>;
53 using Bvh = bvh::Bvh<Node>;
54 using Ray = bvh::Ray<Scalar, 3>;
55 using PrecomputedTri = bvh::PrecomputedTri<Scalar>;
63 std::vector<PrecomputedTri> preTri;
76 GmBVHAcceleration(
const double* triCoords,
const int* triIndex,
int numPoints,
int numTriangles,
int numValidTriangles, bvh::ThreadPool threadPool = bvh::ThreadPool());
83 std::tuple<size_t, size_t, bool, bool, bool> segIntersection(
const double* start,
const double* end,
RayIntersection& ri,
double repelTol = 0,
double repelDistance = 0,
double eps = 1e-5);
94 void zeroIntersection(
const int zeroId,
const size_t triId,
const QVector<int>& nodeIds,
const GmValueAccessor* coordAc,
QVector<std::tuple<RayIntersection, int, bool>>& outIntersect,
double repelTol = 0,
double repelDistance = 0,
double eps = 1e-5);
98 void computeLinePoint(Vec3 p0, Vec3 dir,
double t,
double* out);
135 using Scalar = double;
136 using Vec3 = bvh::Vec<Scalar, 3>;
137 using BBox = bvh::BBox<Scalar, 3>;
138 using Tri = bvh::Tri<Scalar, 3>;
139 using Node = bvh::Node<Scalar, 3>;
140 using Bvh = bvh::Bvh<Node>;
141 using Ray = bvh::Ray<Scalar, 3>;
142 using PrecomputedTri = bvh::PrecomputedTri<Scalar>;
149 std::vector<PrecomputedTri> preTri;
156 bool isVisibleInclusive(
const double* src,
const double* dst,
double eps)
const final {
157 return isVisible<true>(src, dst, eps);
160 bool isVisibleExclusive(
const double* src,
const double* dst,
double eps)
const final {
161 return isVisible<false>(src, dst, eps);
165 template<
bool inclusive>
166 bool isVisible(
const double* src,
const double* dst,
double eps)
const;
174 using Scalar = double;
175 using Vec2 = bvh::Vec<Scalar, 2>;
176 using BBox = bvh::BBox<Scalar, 2>;
177 using Seg = bvh::Seg<Scalar, 2>;
178 using Node = bvh::Node<Scalar,2>;
179 using Bvh = bvh::Bvh<Node>;
180 using Ray = bvh::Ray<Scalar, 2>;
181 using PrecomputedSeg = bvh::PrecomputedSeg<Scalar>;
188 std::vector<PrecomputedSeg> preSeg;
197 bool isVisibleInclusive(
const double* src,
const double* dst,
double eps)
const final {
198 return isVisible<true>(src, dst, eps);
201 bool isVisibleExclusive(
const double* src,
const double* dst,
double eps)
const final {
202 return isVisible<false>(src, dst, eps);
206 template<
bool inclusive>
207 bool isVisible(
const double* src,
const double* dst,
double eps)
const;