MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / test_numpy_pointsbuild1

Function test_numpy_pointsbuild1

test_python/test_numpy_pointsbuild.py:10–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8# mrmesh uses float32 for vertex coordinates
9# however, you could also use float64
10def test_numpy_pointsbuild1():
11 verts = np.ndarray(
12 shape=(4, 3),
13 dtype=np.float32,
14 buffer=np.array(
15 [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [1.0, 1.0, 0.0], [0.0, 1.0, 0.0]],
16 dtype=np.float32,
17 ),
18 )
19
20 pc = mrmeshnumpy.pointCloudFromPoints(verts)
21 assert pc.validPoints.count() == 4
22 assert pc.normals.vec.size() == 0
23
24 # mrmesh uses float32 for vertex coordinates
25 # however, you could also use float64
26
27 norms = np.ndarray(
28 shape=(4, 3),
29 dtype=np.float32,
30 buffer=np.array(
31 [[0.0, 0.0, 1.0], [0.0, 0.0, 1.0], [0.0, 0.0, 1.0], [0.0, 0.0, 1.0]],
32 dtype=np.float32,
33 ),
34 )
35
36 pc = mrmeshnumpy.pointCloudFromPoints(verts, norms)
37 assert pc.validPoints.count() == 4
38 assert pc.normals.vec.size() == 4
39
40
41def test_numpy_points_mesh():

Callers

nothing calls this directly

Calls 2

countMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected