Skip to content

Commit 81b75c5

Browse files
committed
fixed Sphere._vertices used before populated
1 parent 663a05c commit 81b75c5

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
* Fixed `NoneType` error when calling `compas.geometry.Sphere.edges`.
15+
1416
### Removed
1517

1618

src/compas/geometry/shapes/sphere.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def compute_faces(self): # type: () -> list[list[int]]
218218
u = self.resolution_u
219219
v = self.resolution_v
220220

221-
vertices = self._vertices
221+
vertices = self.vertices
222222

223223
faces = []
224224

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import pytest
2+
3+
from compas.geometry import Frame
4+
from compas.geometry import Sphere
5+
6+
7+
@pytest.fixture
8+
def sphere():
9+
return Sphere(450.0, Frame.worldXY())
10+
11+
12+
def test_sphere_discretization(sphere):
13+
assert len(sphere.edges) == 496
14+
assert len(sphere.faces) == 256
15+
assert len(sphere.vertices) == 242

0 commit comments

Comments
 (0)