-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathevocube.pre.py
More file actions
executable file
·18 lines (15 loc) · 918 Bytes
/
evocube.pre.py
File metadata and controls
executable file
·18 lines (15 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python
# pre-processing for evocube.yml
# own module
from dds import *
def pre_processing(input_subfolder: DataFolder, output_subfolder: Optional[Path], arguments: dict, silent_output: bool) -> dict: # return data for the post-processing
data_for_post_processing = dict()
# evocube also wants the surface map, as 'tris_to_tets.txt', inside the output folder, but without the 'triangles' and 'tetrahedra' annotations
with open(input_subfolder.get_file('SURFACE_MAP_TXT'),'r') as infile:
if not silent_output:
print('Writing tris_to_tets.txt...')
assert(output_subfolder is not None)
with open(output_subfolder / 'tris_to_tets.txt','w') as outfile: # where evocube expects the surface map
for line in infile.readlines():
outfile.write(line.split()[0] + '\n') # keep only what is before ' '
return data_for_post_processing