def testGetTriangles(self): vals = [ (2, 0, []), (3, 1, ((0, 1, 2), )), (4, 2, ((0, 1, 3), (1, 2, 4))), (5, 3, ((0, 1, 4), (1, 2, 5), (2, 3, 6))), ] for tpl in vals: nPts, cnt, tris = tpl r = Utils.GetTriangles(nPts) assert len(r) == cnt, f'bad triangle length {len(r)} for probe {str(tpl)}' assert r == tris, f'bad triangle list {str(r)} for probe {str(tpl)}'
def testGetTriangles(self): vals = [ (2, 0, []), (3, 1, ((0, 1, 2), )), (4, 2, ((0, 1, 3), (1, 2, 4))), (5, 3, ((0, 1, 4), (1, 2, 5), (2, 3, 6))), ] for tpl in vals: nPts, cnt, tris = tpl r = Utils.GetTriangles(nPts) assert len(r) == cnt, 'bad triangle length %d for probe %s' % ( len(r), str(tpl)) assert r == tris, 'bad triangle list %s for probe %s' % (str(r), str(tpl))