Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
using UnityEngine;
namespace Leap.Unity.Meshing.Examples {
public class SubtractedDodecahedronExample : MonoBehaviour {
public MeshFilter _meshFilter;
private PolyMesh _polyMesh;
public DodecahedronExample subtractFrom;
public DodecahedronExample subtractUsing;
private void Start() {
_meshFilter.mesh = new Mesh();
_meshFilter.mesh.name = "Subtracted Dodecahedron";
_polyMesh = new PolyMesh();
}
private void Update() {
subtractFrom.InitMesh();
subtractUsing.InitMesh();
PolyMesh.Ops.Subtract(subtractFrom.polyMesh, subtractUsing.polyMesh, _polyMesh);
subtractFrom.UpdateMesh();
subtractUsing.UpdateMesh();
_polyMesh.FillUnityMesh(_meshFilter.mesh);
}
}
}2046045a2This file is pinned to the selected release. Download the original to open it in your design tool.