public void DrawSupertetrahedron() { Bounds meshBounds = _mesh.bounds; _superTetra = Tetra.ComputeCircumTetraOfSphere(meshBounds.center, meshBounds.extents.magnitude); _superTetra.Show(Color.red, 1000); }
public Tetra GetOtherTetraThan(Tetra tetra) { if (tetra.Equals(RightTetra)) { return(LeftTetra); } else if (tetra.Equals(LeftTetra)) { return(RightTetra); } else { tetra.Show(Color.red, 100); Show(Color.cyan, 100); throw new System.Exception("The given tetrahedron is not one of the neighbors of the triangle face"); } }
public void ComputeDelaunayTriangulation() { HashSet <Tetra> triangulation = new HashSet <Tetra> { _superTetra }; foreach (Vertex vertex in _vertices) { HashSet <Tetra> badTetras = GetBadTetrasInCurrentTriangulation(triangulation, vertex); HashSet <TriangleFace> polyHole = GetPolygonalHoleFromBadTetras(badTetras); RemoveBadTetras(triangulation, badTetras); HashSet <Tetra> tetrasToAdd = GetNewTetrasFromPolygonalHole(vertex, polyHole); AddNewTetrasToTriangulation(triangulation, tetrasToAdd); _triangulation = triangulation; } RemoveTetrasFromSuperTetra(triangulation); _triangulation = triangulation; Tetra.Show(triangulation, Color.green, 1000); }