Dynamic Mesh Slicer

The Dynamic Mesh Slicer is a powerful and efficient Unity asset designed to allow users to slice any 3D mesh at runtime dynamically.

Unity 3D Mesh Slicer/Mesh Cutter

This Unity 3D Mesh Slicer is a simple and easy-to-use tool for cutting and deforming 3D meshes. It works with any Unity version and does not rely on specific rendering settings, making it versatile for various projects. The tool is optimized for mobile use, making it a great choice for applications on both mobile and desktop platforms. With its straightforward setup, anyone can add mesh slicing functionality to their game or app without hassle. This asset is developed from scratch using C# libraries with an intuitive system design.

Basic Example:
Example 1
Example 2
Working with Texture:
Texture Example
Complex Mesh:
Complex Mesh

System Design

The system is designed with the MHCutter component managing the process:

  1. Creating an Infinity Plane: Starts by creating a Unity Infinity Plane at the cutting position, used as the slicing reference. Custom planes can be defined for game-specific needs.
  2. Dividing the Target Object: The mesh is split based on triangle data, using MHMesh to store triangle info.
  3. Finding and Modifying Triangles: New points are added to ensure accurate slicing across triangles.
  4. Generating New Triangles: Generates three additional triangles on each new slice.
  5. Filling the Mesh: Ensures the newly created edge forms a connected loop and fills the slice correctly.
  6. Fixing UVs: Adjusts UV mapping to ensure texture accuracy after slicing.

Key Features

Requirements

Known Issues

How to Use/Create:

  1. Create a new Unity scene.
  2. Import the package from the Asset Store.
  3. Create a GameObject, name it Mesh Slicer, and attach the MHSlicer script.
  4. Optionally, add a ClickToCut script to trigger the slicing on mouse click.
  5. Use ScreenPointToRay to get the clicked object, then call the MHCutter's Cut method.
  6. The sliceable object must have a MeshFilter, MeshRenderer, and a Collider (MeshCollider).
  7. To display a new material on the cut surface, add an extra material to the targeted GameObject MeshRenderer. When the cut occurs, this extra material will appear on the newly created surface of both the main object and the sliced object.

⭐ DOWNLOAD 🌟

⭐ Don’t forget to give this Asset a Review in the Asset Store if you find it useful! 🌟

πŸ”— Find me on LinkedIn: LinkedIn Profile