public bool Equals(PolyLine2D other)
        {
            if (this.VertexCount != other?.VertexCount)
            {
                return(false);
            }

            for (var i = 0; i < this.points.Count; i++)
            {
                if (!this.points[i].Equals(other.points[i]))
                {
                    return(false);
                }
            }

            return(true);
        }
Example #2
0
 /// <summary>
 /// Creates a new polygon from the existing polygon by removing any edges whose adjacent segments are considered colinear within the provided tolerance
 /// </summary>
 /// <param name="singleStepTolerance">The tolerance by which adjacent edges should be considered collinear.</param>
 /// <returns>A polygon</returns>
 public Polygon2D ReduceComplexity(double singleStepTolerance)
 {
     return(new Polygon2D(PolyLine2D.ReduceComplexity(this.ToPolyLine2D().Vertices, singleStepTolerance).Vertices));
 }