Ejemplo n.º 1
0
def _save_stl_polys(data):
    try:
        with h5py.File(str(_SIM_DATA.lib_file_write_path(_stl_polygon_file(data.file))), 'w') as hf:
            template_common.dict_to_h5(data, hf, path='/')
    except Exception as e:
        pkdlog('!save_stl_polys FAIL: {}', e)
        pass
Ejemplo n.º 2
0
def _read_or_generate(g_id, data):
    f_type = data.get('fieldType', None)
    res = _read_data(data.simulationId, data.viewType, f_type)
    if res:
        return res
    # No such file or path, so generate the data and write to the existing file
    with h5py.File(_geom_file(data.simulationId), 'a') as hf:
        template_common.dict_to_h5(_generate_data(g_id, data, add_lines=False),
                                   hf,
                                   path=_geom_h5_path(data.viewType, f_type))
    return get_application_data(data)