|
3 | 3 | import unittest
|
4 | 4 | import os
|
5 | 5 | import numpy as np
|
6 |
| -from scipy.misc import imresize |
7 | 6 | from stl_tools import text2array, numpy2stl, text2png
|
8 | 7 |
|
9 | 8 | """
|
@@ -38,23 +37,23 @@ def test_png(self):
|
38 | 37 | """
|
39 | 38 | output_name = "OUT_.stl"
|
40 | 39 | # test ascii output
|
41 |
| - A = imresize([[0, 1], [1, 0]], (64, 64)) |
| 40 | + A = 100*np.random.randn(64, 64) |
42 | 41 | numpy2stl(A, output_name, scale=0.05, mask_val=3., ascii=True)
|
43 | 42 | assert os.path.exists(output_name)
|
44 |
| - assert os.stat(output_name).st_size > 1500000 |
| 43 | + assert os.stat(output_name).st_size > 1e5 |
45 | 44 |
|
46 | 45 | # test binary output
|
47 |
| - numpy2stl(A, output_name, scale=0.05, mask_val=3., ascii=False) |
| 46 | + numpy2stl(A, output_name, scale=0.05, mask_val=3.) |
48 | 47 | assert os.path.exists(output_name)
|
49 |
| - assert os.stat(output_name).st_size > 200000 |
| 48 | + assert os.stat(output_name).st_size > 1e5 |
50 | 49 | os.remove(output_name)
|
51 | 50 |
|
52 | 51 | def test_calc_normals(self):
|
53 | 52 | output_name = "OUT_.stl"
|
54 |
| - A = imresize([[0, 1], [1, 0]], (64, 64)) |
| 53 | + A = 100*np.random.randn(64, 64) |
55 | 54 | numpy2stl(A, output_name, scale=0.05, mask_val=3., calc_normals=True)
|
56 | 55 | assert os.path.exists(output_name)
|
57 |
| - assert os.stat(output_name).st_size > 200000 |
| 56 | + assert os.stat(output_name).st_size > 1e5 |
58 | 57 | os.remove(output_name)
|
59 | 58 |
|
60 | 59 | if __name__ == '__main__':
|
|
0 commit comments