@pimms.value<EOL><INDENT>def all_border_triangle_addresses(edge_data, addresses, closed, intersected_face_paths):<DEDENT>
<EOL>(lhs,rhs,lfs,rfs) = ([],[],[],[])<EOL>for (abc,bcxs) in six.iteritems(intersected_face_paths):<EOL><INDENT>try: (ll,rr) = Path.tesselate_triangle_paths(bcxs)<EOL>except ValueError as e:<EOL><INDENT>if len(e.args) > <NUM_LIT:1> and isinstance(e.args[<NUM_LIT:1>], dict):<EOL><INDENT>e.args[<NUM_LIT:1>]['<STR_LIT:abc>'] = abc<EOL>e.args[<NUM_LIT:1>]['<STR_LIT>'] = bcxs<EOL>e.args[<NUM_LIT:1>]['<STR_LIT>'] = len(lhs)<EOL><DEDENT>raise e<EOL><DEDENT>if len(ll) == <NUM_LIT:0> or len(rr) == <NUM_LIT:0>: continue<EOL>lhs.append(ll)<EOL>rhs.append(rr)<EOL>lfs.append(np.matlib.repmat([abc],ll.shape[<NUM_LIT:2>],<NUM_LIT:1>))<EOL>rfs.append(np.matlib.repmat([abc],rr.shape[<NUM_LIT:2>],<NUM_LIT:1>))<EOL><DEDENT>lhs = np.concatenate(lhs, axis=<NUM_LIT:2>)<EOL>rhs = np.concatenate(rhs, axis=<NUM_LIT:2>)<EOL>lfs = np.vstack(lfs).T<EOL>rfs = np.vstack(rfs).T<EOL>for x in (lhs,rhs,lfs,rfs): x.setflags(write=False)<EOL>return tuple([tuple([pyr.m(faces=fs, coordinates=xs) for xs in hs])<EOL>for (hs,fs) in zip([lhs,rhs],[lfs,rfs])])<EOL>
path.all_border_triangle_addresses contains a nested tuple ((a,b,c), (d,e,f)); each of the
(a,b,c) and (d,e,f) tuples represent arrays of triangles--each of the a-f represent an
addresses-object of points in path.surface that form the triangles' corners. Together, all
the triangles in the two triangle arrays are congruent to the triangles in 
path.intersected_faces; however, the border_triangle_addresses have been split into sets of
smaller triangles that are exclusively on the inner side of the path border (triangles in 
(a,b,c)) and those exclusively on the outer side of the path border (triangles in (d,e,f)).
Among other things, this splitting of the triangles is required to calculate precise
surface area measurements of regions contained by closed paths.

In the case that path is not closed, the triangles in (a,b,c) are on the left side of the
path while those in (d,e,f) are on the right side, with respect to the direction of path.