MeshSplit related operation

Hi community,

I am developing several tools related to terrain modelling. And I found there is a very fundamental operation that need to be done for them. It is similar to MeshSplit but not exactly. I’ve abstracted the operation below:

  1. Red line is a polyline on a base mesh. It can be the result of mesh intersection or polyline projection.
  2. Blue dots are the new vertices the red line creates on the base mesh.
  3. The meshFaces that intersect with the blue dot will be re-triangulated (delaunay I guess) , while other meshFaces remain intact. See images below.


This way I can add detail to the base terrain mesh and manipulate the mesh locally. I am just curious if any algorithms or scripts existed before I invest time to reinvent the wheel.

I’ve searched around the forum for a while. It seems that @Terry_Chappell and @Holo are developing similar tools. It would be great if you two can share some insights.



There is code inside my 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. (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

  1. 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.
  2. Select an Operation
  3. Enter a closed boundary curve (or Select or Reuse an existing curve)
  4. Select options under Show Options
  5. Press button in lower-left corner of GUI with name of operation (Split Mesh for last example).
  6. 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.


Hi @Terry_Chappell,

I greatly appreciate your generosity to share the script. And yes, I am doing this in python. Your script deals with closed boundary. I would like to know whether the “closed” condition is essential for using your method, since I don’t want the base mesh to be trimmed nor split. It will be one single mesh just with new vertices added locally. I want to make sure it is doable to make such tweaks from your procedures.

After having a glimpse of of your code, it seems to me that two most “line-consuming” procedures are find_naked_faces and make_replacement_faces. Are these two the main procedures for solving my problems? I will take some time to read in depth.

Lastly, just a simple suggestion for trimming your gigantic mesh. I would first do a delete mesh face operation to greatly reduce the mesh size.


Your suggestion for speeding up triming the mesh is interesting. I initially tried this but it is faster to create a new mesh inside the boundary and simply ignore the old, much bigger mesh outside the boundary. Much less data to process.

The code only works for a closed boundary curve but all of the curve does not have to lie on the mesh.

The two procedures you identified are the key ones.

Good to know that. I guess it has to do with the way rhino storing mesh data. (something like R-tree?)

I would spend some time study your code and see if I can make it work for my case. Thank you!

Another quick way to do this using just the standard Mesh.CreateBooleanSplit with an extrusion of your curve (8.3 KB)
Not sure how robust this is, but it seems to work.


Hi Daniel,

Mesh Boolean Split is almost unusable for me. Please see below a very simple case.

Would be great if anyone from McNeel can give some explanation on conditions for Mesh Boolean Split operation.


Well something like your image doesn’t work on NURBS surfaces either - you need to have a full and complete intersection for Boolean operations to work, because it needs to analyze the split parts to see which to keep and which to remove. In the case above, MeshSplit works fine though to split the mesh quads while leaving the mesh plane “A” intact.

If you extend mesh “B” to the left so that it cuts all the way through mesh “A”, MeshBooleanSplit works.