Exemplo n.º 1
0
        public Intersection(double x, double y, Vertex vA, Vertex vB, Vertex.VertexType type, LineSegment lsVA, LineSegment lsVB)
        {
            this.x = x;
            this.y = y;

            this.vA = vA;
            this.vB = vB;

            this.type = type;

            this.lsVA = lsVA;
            this.lsVB = lsVB;

            this.distance = MathLibrary.GetDistanceBetweenLineAndVertex(vA, vB, new Vertex(x, y));
        }
Exemplo n.º 2
0
    void ClearVertices(Triangulation triangulation, Vertex.VertexType vertexType)
    {
        for (int i = triangulation.triangles.Count - 1; i > -1; i--)
        {
            for (int w = triangulation.triangles[i].verticesIndexes.Count - 1; w > -1; w--)
            {
                if (triangulation.vertices[triangulation.triangles[i].verticesIndexes[w]].type == vertexType)
                {
                    triangulation.triangles[i].verticesIndexes.RemoveAt(w);
                }
            }

            if (triangulation.triangles[i].verticesIndexes.Count < 3)
            {
                triangulation.triangles.RemoveAt(i);
            }
        }
    }