fix: clip_mesh 改用 brute-force inside test (BVH 射线有容差 bug)
This commit is contained in:
@@ -138,7 +138,8 @@ HalfedgeMesh clip_mesh(const HalfedgeMesh& a, const HalfedgeMesh& b,
|
||||
core::Point3D v2 = a.vertex(vis[2]);
|
||||
core::Point3D centroid = (v0 + v1 + v2) * (1.0 / 3.0);
|
||||
|
||||
bool inside = is_point_inside_bvh(centroid, bvh_b);
|
||||
// Use brute-force check for correct results (BVH ray query has epsilon issues)
|
||||
bool inside = is_point_inside_mesh(centroid, b);
|
||||
if (invert_b) inside = !inside;
|
||||
|
||||
// Keep the face if its centroid is OUTSIDE (b)
|
||||
|
||||
Reference in New Issue
Block a user