I am trying to use a plane to slice through a geometry, and generate a new mesh for the surface that represents the intersection of the plane and the geometry. I am using a clipping plane and getting the clipping plane surface plane. I then use the Mesh.CreateContourCurves method to get an array of curves from the intersection of the plane and the mesh. I then use the Brep.CreatePlanarBreps method to create a collection of breps from those curves, and finally create a mesh using the Mesh.CreateFromBrep method. Sometimes however, I do not get the mesh I expect.
The intersection of the geometry and the clipping plane look correct (there are 5 curves outlined in black, the clipping plane is in yellow).
When I add the output of the Mesh.CreateContourCurves method to the document to visualize the curves, those curves look correct.
But the mesh that is created does not have the expected holes.
I have attached the geometry also. Is this the correct way to create a mesh from the intersection of a plane and a mesh? Any ideas why the mesh that is created is not as expected?
connecting_rod_assembly.3dm (490.0 KB)