forked from pyvista/pyvista
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_geometric_objects.py
68 lines (47 loc) · 1.31 KB
/
test_geometric_objects.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import numpy as np
import vtki
def test_cylinder():
surf = vtki.Cylinder([0, 10, 0], [1, 1, 1], 1, 5)
assert np.any(surf.points)
assert np.any(surf.faces)
def test_arrow():
surf = vtki.Arrow([0, 0, 0], [1, 1, 1])
assert np.any(surf.points)
assert np.any(surf.faces)
def test_sphere():
surf = vtki.Sphere()
assert np.any(surf.points)
assert np.any(surf.faces)
def test_plane():
surf = vtki.Plane()
assert np.any(surf.points)
assert np.any(surf.faces)
def test_line():
line = vtki.Line((0,0,0), (10, 1., 3))
assert line.n_points == 2
assert line.n_cells == 1
line = vtki.Line((0,0,0), (10, 1., 3), 10)
assert line.n_points == 11
assert line.n_cells == 1
def test_cube():
cube = vtki.Cube()
assert np.any(cube.points)
assert np.any(cube.faces)
bounds = (1.,3., 5.,6., 7.,8.)
cube = vtki.Cube(bounds=bounds)
assert np.any(cube.points)
assert np.any(cube.faces)
assert np.allclose(cube.bounds, bounds)
def test_cone():
cone = vtki.Cone()
assert np.any(cone.points)
assert np.any(cone.faces)
def test_box():
geom = vtki.Box()
assert np.any(geom.points)
def test_polygon():
geom = vtki.Polygon()
assert np.any(geom.points)
def test_disc():
geom = vtki.Disc()
assert np.any(geom.points)