@@ -67,7 +67,7 @@ def __str__(self):
6767
6868def geom_add_argument (parser ):
6969 parser .add_argument (
70- "--metadata" , nargs = 1 , help = "input metadata file, only for brep input geometry"
70+ "--metadata" , help = "input metadata file, only for brep input geometry"
7171 )
7272
7373 # set the global parameters
@@ -112,21 +112,26 @@ def geom_add_argument(parser):
112112outputFile = case_name + "_processed.brep" # saved to case output folder
113113if args .outputFile :
114114 outputFile = args .outputFile
115+ print ("args.outputFile = " , args .outputFile )
116+
117+ # output metadata filename
118+ outputMetadataFile = outputFile [: outputFile .rfind ("." )] + "_metadata.json"
115119
116120################################ geom arg ##############################
117- hasInputMetadataFile = True
121+ hasInputMetadataFile = False
118122if args .metadata :
119123 if os .path .exists (args .metadata ):
120124 inputMetadataFile = args .metadata
125+ hasInputMetadataFile = True
121126 else :
122127 raise IOError ("input metadata file does not exist: " , args .metadata )
123128else :
124129 if inputFile .find (".brep" ) > 0 or inputFile .find (".brp" ):
125130 inputMetadataFile = inputFile [: inputFile .rfind ("." )] + "_metadata.json"
126- else :
127- hasInputMetadataFile = False
131+ if os . path . exists ( inputMetadataFile ) :
132+ hasInputMetadataFile = True
128133
129- globalTolerance = 0.001
134+ globalTolerance = 0.001 # length unit is mm
130135if args .tolerance :
131136 globalTolerance = args .tolerance
132137
@@ -138,8 +143,6 @@ def geom_add_argument(parser):
138143if args .ignore_failed != None and args .ignore_failed :
139144 ignoreFailed = True
140145
141- # output metadata filename
142- outputMetadataFile = case_name + "_processed" + "_metadata.json"
143146
144147if debugging > 0 :
145148 print ("action on the geometry is " , args .action )
0 commit comments