Cut

The cut operator splits the mesh into two separate parts based on a defined plane, discarding the mesh on the left handside of the plane.

We will demonstrate this by starting from a simple interactable item:

Simple interactable item
  1. Add the Cut component to your item by clicking Add Component → MAGES → Mesh Deformations → Cut. This will add the following component to your object.

Cut Component Inspector showing all the properties
  1. Click the button as shown below to enable the cut plane adjust tool.

Cut plane adjust tool button in inspector

Warning

In order to be able to see the handles the Editor Gizmos must be enabled.

  1. Use the handles in the scene to adjust the cut plane to match the visual blade of the tool as shown below.

Cut plane adjust tool button in inspector

The size of the plane is shown only for visual fidelity and is not used at all for calculations. The plane in reality expands infinitely.

Note

By hovering your mouse over the Cut Plane Adjust tool in the Unity toolbar you can see the tool key binds used for rotation (Hold Shift) and movement toggle.

  1. Add a trigger collider ( Box in this case ) to match the blade shape. This will be used to perform the cut when a deformable mesh enters the trigger.

That’s it! The Cut script will now automatically slice any deformable mesh that it can intersect. To cut a mesh manually, you can call the “PerformCut” method:

PerformCut(DeformableMesh target)

Properties

Property

Description

BoundedPlane cutPlane

The cut plane. The part of the mesh on that left-hand side will be sliced and discarded upon use.

bool cutLeft

Invert the cutting direction to the opposite side of the plane. The same thing can be accomplished by rotating the plane 180 degrees around it’s base axis

UnityEvent OnCutPerformed

Called whenever this cut script successfully modified a mesh section.