private void SlideCut(Vector3 point1, Vector3 point2) { var condition = point2.y > point1.y; MeshCutter.CutMesh(MainManager.FigureController.MeshFilter, new Plane(condition ? point1 : point2, condition ? point2 : point1, new Vector3(point2.x, point2.y, point2.z + 1))); MainManager.FigureController.UpdateMeshRenderer(); }
void Start() { // Create box Mesh mesh = CreateBoxMesh(3, 1, 1); // Cut box Plane cutPlane = new Plane(_slicePlaneA, _slicePlaneB, _slicePlaneC); mesh = MeshCutter.CutMesh(mesh, cutPlane); // cut again! Plane cutPlane2 = new Plane(_slicePlane2[0], _slicePlane2[1], _slicePlane2[2]); mesh = MeshCutter.CutMesh(mesh, cutPlane2); // cut again!! Plane cutPlane3 = new Plane(_slicePlane3[0], _slicePlane3[1], _slicePlane3[2]); //mesh = MeshCutter.CutMesh(mesh, cutPlane3); GetComponent <MeshFilter>().mesh = mesh; }
private void PointCut(Vector3 clickPoint) { MeshCutter.CutMesh(MainManager.FigureController.MeshFilter, new Plane(Vector3.right, clickPoint)); MainManager.FigureController.UpdateMeshRenderer(); }