File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,18 @@ def test_meshio(self):
31
31
assert len (m .faces ) > 0
32
32
assert m .area > 1e-5
33
33
34
+ def test_load_mesh (self ):
35
+ # test the influence of the parameter `process` for `load_mesh`
36
+ with open (g .os .path .join (g .dir_models , "featuretype.STL" ), "rb" ) as file_obj :
37
+ mesh = g .trimesh .load_mesh (file_obj = file_obj , file_type = "stl" , process = False )
38
+ # check that number of vertices is not being reduced
39
+ assert len (mesh .vertices ) == 10428
40
+
41
+ with open (g .os .path .join (g .dir_models , "featuretype.STL" ), "rb" ) as file_obj :
42
+ mesh = g .trimesh .load_mesh (file_obj = file_obj , file_type = "stl" , process = True )
43
+ # check that number of vertices is being reduced
44
+ assert len (mesh .vertices ) == 1722
45
+
34
46
def test_fileobj (self ):
35
47
# make sure we don't close file objects that were passed
36
48
# check load_mesh
Original file line number Diff line number Diff line change @@ -43,14 +43,14 @@ def load_stl(file_obj, **kwargs):
43
43
# if that is true, it is almost certainly a binary STL file
44
44
# if the header doesn't match the file length a HeaderError will be
45
45
# raised
46
- return load_stl_binary (file_obj )
46
+ return { ** load_stl_binary (file_obj ), ** kwargs }
47
47
except HeaderError :
48
48
# move the file back to where it was initially
49
49
file_obj .seek (file_pos )
50
50
# try to load the file as an ASCII STL
51
51
# if the header doesn't match the file length
52
52
# HeaderError will be raised
53
- return load_stl_ascii (file_obj )
53
+ return { ** load_stl_ascii (file_obj ), ** kwargs }
54
54
55
55
56
56
def load_stl_binary (file_obj ):
You can’t perform that action at this time.
0 commit comments