Пример #1
0
        public static bool AreEqual(this Edge e, Edge edge)
        {
            bool sameOrderEqual = e.Vertex1 == edge.Vertex1 && e.Vertex2 == edge.Vertex2;
            bool oppositeOrderEqal = e.Vertex1 == edge.Vertex2 && e.Vertex2 == edge.Vertex1;

            return sameOrderEqual || oppositeOrderEqal;
        }
Пример #2
0
        public void Returns_correct_edges()
        {
            var edges = _face.Edges;

            var edge0 = new Edge(_vertex0, _vertex1);
            var edge1 = new Edge(_vertex1, _vertex2);
            var edge2 = new Edge(_vertex2, _vertex3);
            var edge3 = new Edge(_vertex3, _vertex0);

            edges.Should().Contain(edge => edge.AreEqual(edge0));
            edges.Should().Contain(edge => edge.AreEqual(edge1));
            edges.Should().Contain(edge => edge.AreEqual(edge2));
            edges.Should().Contain(edge => edge.AreEqual(edge3));
        }
Пример #3
0
 public static bool HasEdge(this Face f, Edge edge)
 {
     var edges = f.Edges;
     return edges.Any(e => e == edge);
 }
Пример #4
0
 public bool Equals(Edge other)
 {
     return this == other;
 }