Пример #1
0
def compute_faces(ipl, key):

    faces = IPL(data={key: ipl[key]})
    shp = faces[key].shape
    ipl.logging('Computing faces ...')
    faces.get_faces_with_neighbors(keys=key, rtrntype=IPL)

    # startpoints = ipl['faces', keys[0]].keys()
    additionalinfo = IPL()
    startpoints = IPL(data={'xyf': shp[2],
                   'xyb': shp[2],
                   'xzf': shp[1],
                   'xzb': shp[1],
                   'yzf': shp[0],
                   'yzb': shp[0]})
    areas = IPL(data={'xyf': np.s_[shp[2]:shp[2] + shp[0], shp[2]:shp[2] + shp[1]],
             'xyb': np.s_[shp[2]:shp[2] + shp[0], shp[2]:shp[2] + shp[1]],
             'xzf': np.s_[shp[1]:shp[1] + shp[0], shp[1]:shp[1] + shp[2]],
             'xzb': np.s_[shp[1]:shp[1] + shp[0], shp[1]:shp[1] + shp[2]],
             'yzf': np.s_[shp[0]:shp[0] + shp[1], shp[0]:shp[0] + shp[2]],
             'yzb': np.s_[shp[0]:shp[0] + shp[1], shp[0]:shp[0] + shp[2]]})

    additionalinfo[key, 'startpoints'] = startpoints
    additionalinfo[key, 'areas'] = areas

    return (faces, additionalinfo)