File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 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):
3131 assert len (m .faces ) > 0
3232 assert m .area > 1e-5
3333
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+
3446 def test_fileobj (self ):
3547 # make sure we don't close file objects that were passed
3648 # check load_mesh
Original file line number Diff line number Diff line change @@ -43,14 +43,14 @@ def load_stl(file_obj, **kwargs):
4343 # if that is true, it is almost certainly a binary STL file
4444 # if the header doesn't match the file length a HeaderError will be
4545 # raised
46- return load_stl_binary (file_obj )
46+ return { ** load_stl_binary (file_obj ), ** kwargs }
4747 except HeaderError :
4848 # move the file back to where it was initially
4949 file_obj .seek (file_pos )
5050 # try to load the file as an ASCII STL
5151 # if the header doesn't match the file length
5252 # HeaderError will be raised
53- return load_stl_ascii (file_obj )
53+ return { ** load_stl_ascii (file_obj ), ** kwargs }
5454
5555
5656def load_stl_binary (file_obj ):
You can’t perform that action at this time.
0 commit comments