Exemplo n.º 1
0
    public static List <Triangle> CleanMesh(IEnumerable <Triangle> triangles)
    {
        List <Vector2> samplePoints = new List <Vector2>();

        foreach (var triangle in triangles)
        {
            samplePoints.AddRange(getSamplePoints(triangle));
        }

        return(MeshCleaner.SampleMesh(triangles, samplePoints).ToList());
    }
Exemplo n.º 2
0
    public Mesh GetMesh()
    {
        if (this.mesh == null)
        {
            if (this.CleanMesh)
            {
                var cleanedTriangles = MeshCleaner.CleanMesh(this.Triangles);
                Timekeeping.CompleteTask("Clean mesh");
                this.mesh = Triangle.CreateMesh(cleanedTriangles, true);
            }
            else
            {
                this.mesh = Triangle.CreateMesh(this.Triangles, true);
            }
        }

        return(this.mesh);
    }