Mesh Slicing (Unity C#)
Updated: Nov 27, 2019
As a bit of a fun side project over the holiday I decided to look into mesh slicing. Little did I know it turned out to be more of a task than I first thought! It took a great deal of research as the majority of sources I found did not include specific instructions or formulas.
The slicer works by first checking how a plane attached to the blade hits the object. This information is used to determine which vertices of the object are on which side of the plane and are then grouped together and 're-stitched' into two cohesive objects. Which are then instantiated and voila! In the end I was able to get the slicing working really well except for more complicated objects where the new part of the object has too many vertices, however all in all I must say it is incredibly satisfying to cut things up!