I’m doing the following:
- loop through all the faces,
- take their respective center points,
- check if they collide with any of the inner curves’ bounding boxes,
- if they do, perform a more through, but also more expensive inclusion detection using the winding number
- if inclusion detected, remove the face from the mesh
Point3d center; List<int> faceIndex = new List<int>(); for (int i = 0; i < mesh.Faces.Count; i++) { center = mesh.Faces.GetFaceCenter(i); for (int j = 0; j < iCurves.Count; j++) if (center.X > bBoxes[j + 1].Min.X && center.X < bBoxes[j + 1].Max.X && center.Y > bBoxes[j + 1].Min.Y && center.Y < bBoxes[j + 1].Max.Y) if (PointInPolygon(center, polylineList[j + 1].ToArray())) faceIndex.Add(i); }
It all seems robust, but I’d like to avoid checking every single face against every single inner curve. For 10 000 curves it takes a significant amount of time…