File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,9 @@ def extract_materials_from_stp(stp_file):
6969
7070 return stl_materials
7171
72- def extract_solids_from_stp (stp_file ):
72+ def extract_solids_from_stp (stp_file , path = '' ):
73+ if path and not path .endswith ('/' ):
74+ path += '/'
7375 solids , materials = extract_names_from_stp (stp_file )
7476 stl_solids = {}
7577 for i in range (len (list (solids .keys ()))):
@@ -84,7 +86,7 @@ def extract_solids_from_stp(stp_file):
8486 solid_re = re .sub (r'[^a-zA-Z0-9_-]' , '-' , solid )
8587 mat_re = re .sub (r'[^a-zA-Z0-9_-]' , '-' , mat )
8688 name = f'{ str (i ).zfill (3 )} _{ solid_re } _{ mat_re } '
87- stl_solids [f'{ str (i ).zfill (3 )} _{ solid_re } ' ] = name + '.stl'
89+ stl_solids [f'{ str (i ).zfill (3 )} _{ solid_re } ' ] = path + name + '.stl'
8890
8991 return stl_solids
9092
You can’t perform that action at this time.
0 commit comments