@@ -578,25 +578,22 @@ def test_visualization_polydata():
578578 rel = 1e-6 ,
579579 abs = 1e-8 ,
580580 )
581- assert polygon .visualization_polydata .n_faces == 2
582581 assert polygon .visualization_polydata .n_cells == 2
583582 assert polygon .visualization_polydata .n_points == 5
584583 assert polygon .visualization_polydata .n_open_edges == 5
585584
586585 # Test for arc visualization polydata
587586 arc = Arc (Point2D ([10 , 10 ]), Point2D ([10 , - 10 ]), Point2D ([10 , 0 ]))
588- assert arc .visualization_polydata .center == ([5.0 , 0.0 , 0.0 ])
587+ assert arc .visualization_polydata .center == pytest . approx ([5.0 , 0.0 , 0.0 ])
589588 assert arc .visualization_polydata .bounds == pytest .approx ([0.0 , 10.0 , - 10.0 , 10.0 , 0.0 , 0.0 ])
590- assert arc .visualization_polydata .n_faces == 2
591589 assert arc .visualization_polydata .n_cells == 2
592590 assert arc .visualization_polydata .n_points == 202
593591 assert arc .visualization_polydata .n_open_edges == 0
594592
595593 # Test for segment visualization polydata
596594 segment = SketchSegment (Point2D ([3 , 2 ]), Point2D ([2 , 0 ]))
597- assert segment .visualization_polydata .center == ([2.5 , 1.0 , 0.0 ])
595+ assert segment .visualization_polydata .center == pytest . approx ([2.5 , 1.0 , 0.0 ])
598596 assert segment .visualization_polydata .bounds == pytest .approx ([2.0 , 3.0 , 0.0 , 2.0 , 0.0 , 0.0 ])
599- assert segment .visualization_polydata .n_faces == 1
600597 assert segment .visualization_polydata .n_cells == 1
601598 assert segment .visualization_polydata .n_points == 2
602599 assert segment .visualization_polydata .n_open_edges == 0
@@ -609,20 +606,18 @@ def test_visualization_polydata():
609606 )
610607 assert slot .visualization_polydata
611608 assert slot .visualization_polydata .bounds == pytest .approx ([0.0 , 4.0 , 2.0 , 4.0 , 0.0 , 0.0 ])
612- assert slot .visualization_polydata .center == ([2.0 , 3.0 , 0.0 ])
609+ assert slot .visualization_polydata .center == pytest . approx ([2.0 , 3.0 , 0.0 ])
613610 # Two arcs and segments creates the slot, thus it should have 6 faces
614- assert slot .visualization_polydata .n_faces == 6
615611 assert slot .visualization_polydata .n_cells == 6
616612 assert slot .visualization_polydata .n_points == 402
617613 assert slot .visualization_polydata .n_open_edges == 0
618614
619615 # Test for triangle visualization polydata
620616 triangle = Triangle (Point2D ([10 , 10 ]), Point2D ([2 , 1 ]), Point2D ([10 , - 10 ]))
621- assert triangle .visualization_polydata .center == ([6.0 , 0.0 , 0.0 ])
617+ assert triangle .visualization_polydata .center == pytest . approx ([6.0 , 0.0 , 0.0 ])
622618 assert triangle .visualization_polydata .bounds == pytest .approx (
623619 [2.0 , 10.0 , - 10.0 , 10.0 , 0.0 , 0.0 ]
624620 )
625- assert triangle .visualization_polydata .n_faces == 1
626621 assert triangle .visualization_polydata .n_cells == 1
627622 assert triangle .visualization_polydata .n_points == 3
628623 assert triangle .visualization_polydata .n_open_edges == 3
@@ -639,7 +634,6 @@ def test_visualization_polydata():
639634 rel = 1e-6 ,
640635 abs = 1e-8 ,
641636 )
642- assert trapezoid .visualization_polydata .n_faces == 1
643637 assert trapezoid .visualization_polydata .n_cells == 1
644638 assert trapezoid .visualization_polydata .n_points == 4
645639 assert trapezoid .visualization_polydata .n_open_edges == 4
@@ -648,18 +642,16 @@ def test_visualization_polydata():
648642 circle = SketchCircle (
649643 Point2D ([10 , - 10 ], DEFAULT_UNITS .LENGTH ), Quantity (1 , DEFAULT_UNITS .LENGTH )
650644 )
651- assert circle .visualization_polydata .center == pytest .approx (( [10.0 , - 10.0 , 0.0 ]) )
645+ assert circle .visualization_polydata .center == pytest .approx ([10.0 , - 10.0 , 0.0 ])
652646 assert circle .visualization_polydata .bounds == pytest .approx ([9.0 , 11.0 , - 11.0 , - 9.0 , 0.0 , 0.0 ])
653- assert circle .visualization_polydata .n_faces == 1
654647 assert circle .visualization_polydata .n_cells == 1
655648 assert circle .visualization_polydata .n_points == 100
656649 assert circle .visualization_polydata .n_open_edges == 100
657650
658651 # Test for ellipse visualization polydata
659652 ellipse = SketchEllipse (Point2D ([0 , 0 ], UNITS .m ), Quantity (1 , UNITS .m ), Quantity (1 , UNITS .m ))
660- assert ellipse .visualization_polydata .center == pytest .approx (( [0.0 , 0.0 , 0.0 ]) )
653+ assert ellipse .visualization_polydata .center == pytest .approx ([0.0 , 0.0 , 0.0 ])
661654 assert ellipse .visualization_polydata .bounds == pytest .approx ([- 1.0 , 1.0 , - 1.0 , 1.0 , 0.0 , 0.0 ])
662- assert ellipse .visualization_polydata .n_faces == 1
663655 assert ellipse .visualization_polydata .n_cells == 1
664656 assert ellipse .visualization_polydata .n_points == 100
665657 assert ellipse .visualization_polydata .n_open_edges == 100
@@ -670,9 +662,8 @@ def test_visualization_polydata():
670662 Distance (4 , unit = UNITS .meter ),
671663 Distance (2 , unit = UNITS .meter ),
672664 )
673- assert box .visualization_polydata .center == ([3.0 , 1.0 , 0.0 ])
665+ assert box .visualization_polydata .center == pytest . approx ([3.0 , 1.0 , 0.0 ])
674666 assert box .visualization_polydata .bounds == pytest .approx ([1.0 , 5.0 , 0.0 , 2.0 , 0.0 , 0.0 ])
675- assert box .visualization_polydata .n_faces == 1
676667 assert box .visualization_polydata .n_cells == 1
677668 assert box .visualization_polydata .n_points == 4
678669 assert box .visualization_polydata .n_open_edges == 4
0 commit comments