File tree Expand file tree Collapse file tree 4 files changed +54
-3
lines changed Expand file tree Collapse file tree 4 files changed +54
-3
lines changed Original file line number Diff line number Diff line change 1+ import pytest
2+
3+ from compas .geometry import Capsule
4+
5+
6+ @pytest .fixture
7+ def capsule ():
8+ return Capsule (123.0 , 13.0 )
9+
10+
11+ def test_capsule_discretization (capsule ):
12+ # just checking these don't break. Could not quickly find a formula that worked to test the actual values
13+ # as function of the resolution
14+ assert capsule .edges
15+ assert capsule .faces
16+ assert capsule .vertices
Original file line number Diff line number Diff line change 1+ import pytest
2+
3+ from compas .geometry import Cone
4+
5+
6+ @pytest .fixture
7+ def cone ():
8+ return Cone (432.0 , 123.0 )
9+
10+
11+ def test_cone_discretization (cone ):
12+ # just checking these don't break. Could not quickly find a formula that worked to test the actual values
13+ # as function of the resolution
14+ assert cone .edges
15+ assert cone .faces
16+ assert cone .vertices
Original file line number Diff line number Diff line change 1+ import pytest
2+ from compas .geometry import Cylinder
3+
4+
5+ @pytest .fixture
6+ def cylinder ():
7+ return Cylinder (radius = 0.3 , height = 1.6 )
8+
9+
10+ def test_cylinder_discretization (cylinder ):
11+ # just checking these don't break. Could not quickly find a formula that worked to test the actual values
12+ # as function of the resolution
13+ assert cylinder .edges
14+ assert cylinder .faces
15+ assert cylinder .vertices
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ def sphere():
1010
1111
1212def test_sphere_discretization (sphere ):
13- assert len (sphere .edges ) == 496
14- assert len (sphere .faces ) == 256
15- assert len (sphere .vertices ) == 242
13+ expected_face_count = sphere .resolution_v * sphere .resolution_u
14+ expected_vertex_count = (sphere .resolution_v - 1 ) * sphere .resolution_u + 2
15+ expected_edge_count = expected_face_count * 2 - sphere .resolution_u
16+
17+ assert len (sphere .edges ) == expected_edge_count
18+ assert len (sphere .faces ) == expected_face_count
19+ assert len (sphere .vertices ) == expected_vertex_count
You can’t perform that action at this time.
0 commit comments