There is code inside my TrimMeshForDD.py script that will do what you want. Please take a look and see if you can sort out what the code has to offer. It contains many comments and tries to fully document each procedure in this 6000+ line script. It will run without the two files mentioned at the top of the script; these are for window dressing (shows picture of operation) and to speed up computing the volume of a trimmed mesh. It uses a ETO GUI interface.
TrimMeshForDD.py (367.4 KB)
Here is a screen capture of the script used to trim a mesh:
and here is a closeup of the trimmed mesh:
The mesh can also be split with the script:
Notice that the mesh is split under the green boundary curve (reused from Trim operation). The green curve is like the red curve in your picture. The mesh faces cut by the boundary curve have been replaced by new triangles which are joined to the uncut mesh.
To use the script:
0. Display only 1 mesh in the Top View
- Run the script. This will move the mesh to the Start layer and copy it to the Normal layer. The mesh on the Start layer is never changed. It is your original mesh.
- Select an Operation
- Enter a closed boundary curve (or Select or Reuse an existing curve)
- Select options under Show Options
- Press button in lower-left corner of GUI with name of operation (Split Mesh for last example).
- Use Layers panel to control display of results.
This script works on all my meshes including many that Rhino’s built in Mesh Tools cannot split or trim correctly. It does not work on all meshes as there seems to be no limit to how many special cases there are that need special handling.
Hope this helps. I wrote this script because I could not get my meshes to split at all or in reasonable time. It is many times faster that Rhino’s Mesh Tools for splitting my large meshes (>5M faces).
If you are not into writing scripts or Python, then this may not be of much help to you. For my application of analyzing 3D models created from drone photos using photogrammetry, it is better than anything I have seen on the DroneDeploy and similar forums.