File Exchange

image thumbnail


version 1.0.1 (63.8 KB) by Yury
Returns intersections between a triangulation mesh and a set of planes


Updated 12 Feb 2019

GitHub view license on GitHub

mesh_xsections() is a Matlab function returning cross-sections of a triangulation mesh with a set of planes. Each cross-section is a cell array with one or more polygons (consecutive points in 3D). The function handles meshes with duplicated vertices (by fusing them) and open boundary edges (by cutting across the edge). It also removes duplicated faces and slightly budges mesh vertices if the plane happens to intersect them. mesh_xsections executes in a matter of seconds on meshes with hundreds of thousands of vertices.

Cite As

Yury (2020). mesh_xsections (, GitHub. Retrieved .

Comments and Ratings (2)

Hello Yuri,

This function seems to be very useful.
Thank you very much.

However, I am facing two problems:

1. I am getting an error messages like:
Mesh topology: edge 122 has more than 2 faces attached to it! And, the program terminates without any output.
How to overcome this issue?

2. I have data of about more than 700K Faces and vertices.
The program is running extremely slow on such a huge mesh.
Is there a way to speed up?

If these two problems are resolved the this would be a great function to use, at least for me.
Thank you.

this is the error that i got regarding this script. I am using the Slicer software to export my .obj file and the file represents the surface of a calcium deposit in the carotid artery.

Unable to perform assignment because dot indexing is not supported for variables of this type.

Error in read_wobj (line 191)



Checks the mesh for duplicate faces and removes them now.
Checks if the plane happens to intersect mesh vertices and budges them slightly if necessary.

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux