API for MeshTrim

Hello,
I’m looking for trimming one mesh with another mesh in Rhino. While there is an option in Rhino’s interface called “MeshTrim” for this purpose, I’m seeking guidance on how to achieve the same result using the Rhino API (RhinoCommon) since there doesn’t appear to be a dedicated API method for this operation.

Regards
Bhavita

I think you can probably use Mesh.Split, then figure out which pieces to keep based on some rules that are specific for your application.

https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.mesh/split