-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglobal_padding.post.py
executable file
·40 lines (35 loc) · 1.38 KB
/
global_padding.post.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
# post-processing for global_padding.yml
from shutil import move
from pathlib import Path
from os import unlink
# own module
from dds import *
def post_processing(input_subfolder: DataFolder, output_subfolder: Optional[Path], arguments: dict, data_from_pre_processing: dict, silent_output: bool):
assert(input_subfolder.type == 'hex-mesh')
assert(output_subfolder is not None)
# The executable also writes debug files
for debug_filename in [
'debug_volume_0.geogram',
'debug_input_hexmesh_1.geogram',
'debug_surface_2.geogram',
'debug_pillowed_3.geogram',
'debug_number_of_componant_4.geogram',
'debug_det_iter_0__5.geogram',
'debug_det_iter_1__6.geogram',
'debug_det_iter_2__7.geogram',
'debug_det_iter_3__8.geogram',
'debug_det_iter_4__9.geogram',
'debug_det_iter_5__10.geogram',
'debug_smoothed_11.geogram',
'view.lua'
]:
if Path(debug_filename).exists():
if arguments['keep_debug_files']:
if not silent_output:
print(f'Renaming {debug_filename}...')
move(debug_filename, output_subfolder / f'rb_perform_postprocessing.{debug_filename}')
else:
if not silent_output:
print(f'Removing {debug_filename}...')
unlink(debug_filename)