def test_has_constraints_true_face(self): """ a face is constrained by a non-candidate face """ logging.info("Starting test has constraints true face") f = self.dc.newFace(coords=np.array([[10,10],[11,10],[10,11]])) f2 = dcel.Face() f.edgeList[0].twin.face = f2 self.assertTrue(f.has_constraints())
def test_faceSwap(self): """ Test the swapping of faces on two halfedges """ #assign faces to each he, swap them f1 = dcel.Face() f2 = dcel.Face(site=np.array([1,1])) he = dcel.HalfEdge() e = dcel.HalfEdge(twin=he) e.face = f1 he.face = f2 self.assertEqual(e.face, f1) self.assertEqual(e.twin.face, f2) e.swapFaces() self.assertEqual(e.face, f2) self.assertEqual(e.twin.face, f1)
def test_has_constraints_false_face_candidate(self): """ a face isn't constrained by a passed in candidate face """ f = self.dc.newFace(coords=np.array([[10,10],[11,10],[10,11]])) f2 = dcel.Face() f.edgeList[0].twin.face = f2 self.assertFalse(f.has_constraints(set([f2])))
def test_has_constraints_false_abitrary(self): """ a face isn't constrained by arbitrary candidates """ f = dcel.Face() self.assertFalse(f.has_constraints(set(["a"])))
def test_has_constraints_false(self): """ A face isn't constrained by default """ f = dcel.Face() self.assertFalse(f.has_constraints())
def test_face_creation(self): """ Test basic face construction """ f = dcel.Face() self.assertIsNotNone(f) self.assertIsInstance(f, dcel.Face)