def measure_dimension(fbasename=None, log=None, axis1=None, offset1=<NUM_LIT:0.0>,<EOL>axis2=None, offset2=<NUM_LIT:0.0>, ml_version=ml_version):
axis1 = axis1.lower()<EOL>axis2 = axis2.lower()<EOL>ml_script1_file = '<STR_LIT>'<EOL>file_out = '<STR_LIT>'<EOL>ml_script1 = mlx.FilterScript(file_in=fbasename, file_out=file_out, ml_version=ml_version)<EOL>compute.section(ml_script1, axis1, offset1, surface=True)<EOL>compute.section(ml_script1, axis2, offset2, surface=False)<EOL>layers.delete_lower(ml_script1)<EOL>ml_script1.save_to_file(ml_script1_file)<EOL>ml_script1.run_script(log=log, script_file=ml_script1_file)<EOL>for val in ('<STR_LIT:x>', '<STR_LIT:y>', '<STR_LIT:z>'):<EOL><INDENT>if val not in (axis1, axis2):<EOL><INDENT>axis = val<EOL><DEDENT><DEDENT>axis_num = ord(axis) - ord('<STR_LIT:x>')<EOL>aabb = measure_aabb(file_out, log)<EOL>dimension = {'<STR_LIT>': aabb['<STR_LIT>'][axis_num], '<STR_LIT>': aabb['<STR_LIT>'][axis_num],<EOL>'<STR_LIT>': aabb['<STR_LIT:size>'][axis_num], '<STR_LIT>': axis}<EOL>if log is None:<EOL><INDENT>print('<STR_LIT>' % fbasename)<EOL>print('<STR_LIT>' % (axis, axis1, offset1,<EOL>axis2, offset2))<EOL>print('<STR_LIT>' % (dimension['<STR_LIT>'],<EOL>dimension['<STR_LIT>'], dimension['<STR_LIT>']))<EOL><DEDENT>else:<EOL><INDENT>log_file = open(log, '<STR_LIT:a>')<EOL>log_file.write('<STR_LIT>' % fbasename)<EOL>log_file.write('<STR_LIT>' % (axis, axis1, offset1,<EOL>axis2, offset2))<EOL>log_file.write('<STR_LIT>' % dimension['<STR_LIT>'])<EOL>log_file.write('<STR_LIT>' % dimension['<STR_LIT>'])<EOL>log_file.write('<STR_LIT>' % dimension['<STR_LIT>'])<EOL>log_file.close()<EOL><DEDENT>return dimension<EOL>
Measure a dimension of a mesh