def dict_to_g6a(geometry_dict: dict, result_path: str) -> bool:
    """
    Turns a dictionary into a delphin geometry file.

    :param geometry_dict: Dictionary holding the information for the geometry file
    :param result_path: Path to were the geometry file should be written
    :return: True
    """

    file_obj = open(result_path + '/' + geometry_dict['name'] + '.g6a', 'w')

    file_obj.write('D6GARLZ! ' + str(geometry_dict['D6GARLZ']) + '\n')

    file_obj.write('TABLE  MATERIALS\n')
    for material in geometry_dict['materials']:
        file_obj.write(str(material[0]) + '        ' + str(material[1]) + ' ' + str(material[2] + '\n'))

    file_obj.write('\nTABLE  GRID\n')
    for dimension in geometry_dict['grid']:
        if not dimension == 'z':
            file_obj.write(' '.join([str(int(element_)) if element_ == int(element_) else str(element_)
                                     for element_ in geometry_dict['grid'][dimension]]) + ' \n')

        else:
            file_obj.write(' '.join([str(int(element_)) if element_ == int(element_) else str(element_)
                                     for element_ in geometry_dict['grid'][dimension]]) + '\n')

    file_obj.write('\nTABLE  ELEMENT_GEOMETRY\n')
    for element in geometry_dict['element_geometry']:
        space0 = ' ' * (9 - len(str(int(element[0]))))
        space1 = ' ' * max((10 - len(str(element[1]))), 1)
        space2 = ' ' * (29 - len(str(int(element[0])) + space0 + str(element[1]) + space1 + str(element[2])))
        space3 = ' ' * (6 - len(str(int(element[3]))))
        space4 = ' ' * (6 - len(str(int(element[4]))))

        file_obj.write(str(int(element[0])) + space0 + str(element[1]) + space1 + str(element[2]) + space2 + '\t ' +
                       str(int(element[3])) + space3 + str(int(element[4])) + space4 + str(int(element[5])) + '\n')

    file_obj.write('\nTABLE  SIDES_GEOMETRY\n')
    for side in geometry_dict['sides_geometry']:
        if side[1] == int(side[1]):
            side[1] = int(side[1])

        space0 = ' ' * (9 - len(str(int(side[0]))))
        space1 = ' ' * max((10 - len(str(side[1]))), 1)
        space2 = ' ' * (29 - len(str(int(side[0])) + space0 + str(side[1]) + space1 + str(side[2])))
        space3 = ' ' * (7 - len(str(int(side[3]))))
        space4 = ' ' * (7 - len(str(int(side[4]))))
        space5 = ' ' * 4

        file_obj.write(str(int(side[0])) + space0 + str(side[1]) + space1 + str(side[2]) + space2 + '\t ' +
                       str(int(side[3])) + space3 + str(int(side[4])) + space4 + str(int(side[5])) + space5 + '\n')

    file_obj.write('\n')
    file_obj.close()

    return True