@pimms.value<EOL><INDENT>def intersected_face_paths(edge_data, addresses, closed):<DEDENT>
(faces, coords) = address_data(addresses, <NUM_LIT:2>)<EOL>coords = np.vstack([coords, [<NUM_LIT:1> - np.sum(coords, axis=<NUM_LIT:0>)]])<EOL>(faces, coords) = [x.T for x in (faces,coords)]<EOL>def bc_conv(f0, x0, ftarg):<EOL><INDENT>r = np.zeros(len(x0))<EOL>for (f,x) in zip(f0,x0):<EOL><INDENT>if   np.isclose(x, <NUM_LIT:0>, atol=<NUM_LIT>): continue<EOL>elif f in ftarg:                  r[f == ftarg] = x<EOL>elif np.isclose(x, <NUM_LIT:0>, atol=<NUM_LIT>): continue<EOL>else: raise ValueError('<STR_LIT>',<EOL>dict(edge_data=edge_data, addresses=addresses, closed=closed,<EOL>f0=f0, x0=x0, ftarg=ftarg, f=f, x=x))<EOL><DEDENT>return r<EOL><DEDENT>(fs,ps) = edge_data[<NUM_LIT:4>:<NUM_LIT:6>]<EOL>if fs[-<NUM_LIT:1>] is None: fs = fs[:-<NUM_LIT:1>]<EOL>fs = np.asarray([np.roll(f, -np.argmin(f)) for f in fs])<EOL>idx = AutoDict()<EOL>idx.on_miss = lambda:[]<EOL>for (f,p) in zip(zip(*fs.T), ps): idx[f].append(p)<EOL>def to_bcs(f,ps):<EOL><INDENT>bcs = np.asarray([bc_conv(faces[p], coords[p], f) for p in ps]).T[:<NUM_LIT:2>]<EOL>bcs.setflags(write=False)<EOL>return bcs<EOL><DEDENT>try: return pyr.pmap({f: tuple([to_bcs(f,p) for p in ps]) for (f,ps) in six.iteritems(idx)})<EOL>except ValueError as e:<EOL><INDENT>if len(e.args) > <NUM_LIT:1> and isinstance(e.args[<NUM_LIT:1>], dict): e.args[<NUM_LIT:1>]['<STR_LIT>'] = idx<EOL>raise<EOL><DEDENT>
path.intersected_face_paths is a dict of all the faces intersected by the the given path
along with the barycentric coordinates of all points that lie in that face. This means that
if you instantiate these points and list them all there will be duplicate points every time
the path crosses an edge. Keys of this dict are the face tuples (a,b,c) rotated such that a
is always the label with the lowest value.