def test_case1(self): # куб полностью вне сферы со сторонами 1 1 1 test1 = Polyedr(f"data/test_case1.geom") assert test1.sum_of_edges == approx(7110.716, 2)
def test_case7(self): # параллелепипед частично в сфере, 4 точки хороших, выступают по оси Z test7 = Polyedr(f"data/test_case7.geom") assert test7.sum_of_edges == approx(2867.525, 2)
def test_case8(self): # параллелепипед частично в сфере, 4 точки хороших, выступают по отрицательному направлению оси Х test8 = Polyedr(f"data/test_case8.geom") assert test8.sum_of_edges == approx(5140.199, 2)
def test_case5(self): # тетраедр частично в сфере, только одна хорошая точка test5 = Polyedr(f"data/test_case5.geom") assert test5.sum_of_edges == approx(618.089, 2)
def test_case6(self): # тетраедр частично в сфере, только одна "нехорошая" точка test6 = Polyedr(f"data/test_case6.geom") assert test6.sum_of_edges == approx(7372.072, 2)
def test_case4(self): # тетраедр полностью внутри сферы, хороших точек нет test4 = Polyedr(f"data/test_case4.geom") assert test4.sum_of_edges == 0
def test_case3(self): # куб полностью внутри сферы, хороших точек нет test3 = Polyedr(f"data/test_case3.geom") assert test3.sum_of_edges == 0
def test_case2(self): # тетраедр полностью вне фигуры test2 = Polyedr(f"data/test_case2.geom") print(5) assert test2.sum_of_edges == approx(10183.055, 2)
#!/usr/bin/env -S python3 -B from time import time from common.tk_drawer import TkDrawer from shadow.polyedr import Polyedr tk = TkDrawer() try: for name in ["ccc", "cube", "box", "king", "cow"]: print("=============================================================") print(f"Начало работы с полиэдром '{name}'") start_time = time() Polyedr(f"data/{name}.geom").draw(tk) delta_time = time() - start_time print(f"Изображение полиэдра '{name}' заняло {delta_time} сек.") input("Hit 'Return' to continue -> ") except (EOFError, KeyboardInterrupt): print("\nStop") tk.close()
#!/usr/bin/env -S python3 -B from time import time from common.tk_drawer import TkDrawer from shadow.polyedr import Polyedr tk = TkDrawer() try: list_of_cases = [ "test_case1", "test_case2", "test_case3", "test_case4", "test_case5", "test_case6", "test_case7", "test_case8" ] # for name in ["ccc", "cube", "box", "king", "cow"]: for name in list_of_cases: print("=============================================================") print(f"Начало работы с полиэдром '{name}'") start_time = time() # Polyedr(f"data/{name}.geom").draw(tk) Polyedr(f"data/{name}.geom") delta_time = time() - start_time print(f"Изображение полиэдра '{name}' заняло {delta_time} сек.") input("Hit 'Return' to continue -> ") except (EOFError, KeyboardInterrupt): print("\nStop") tk.close()