// for a forward edge index is the source vertex; for a backward edge index is the target vertex public Edge(IPolygon3 polygon, IClosedPolyline3 contour, int edgeIdx, Direction direction) { _polygon = polygon; _contour = contour; _edgeIdx = edgeIdx; _direction = direction; }
public static void ExpectClosedPolylinesAreEqual(IClosedPolyline3 line1, IClosedPolyline3 line2, double tolerance) { Assert.That(line1.Vertices.Count, Is.EqualTo(line2.Vertices.Count)); foreach (var i in Enumerable.Range(0, line2.Vertices.Count)) { if (Vector3.Distance(line1.Vertices[i], line2.Vertices[0]) < tolerance) { foreach (int j in Enumerable.Range(0, line1.Vertices.Count)) { Assert.That(Vector3.Distance(line1.Vertices[j], line2.Vertices.ElementAtCyclic(j - i)), Is.LessThan(tolerance)); } return; } } Assert.Fail(); }
public static IClosedPolyline3 AsReverse(this IClosedPolyline3 @this) { return(new ClosedPolyline3(@this.Vertices.AsReverse())); }
public Vertex(IPolygon3 polygon, IClosedPolyline3 contour, int vertexIdx) { _polygon = polygon; _contour = contour; _vertexIdx = vertexIdx; }