@testing.requires_testing_data
def test_triangle_neighbors():
 this = read_source_spaces(fname)[0]
 this['neighbor_tri'] = [list() for _ in range(this['np'])]
 for p in range(this['ntri']):
  verts = this['tris'][p]
  this['neighbor_tri'][verts[0]].append(p)
  this['neighbor_tri'][verts[1]].append(p)
  this['neighbor_tri'][verts[2]].append(p)
 this['neighbor_tri'] = [np.array(nb, int) for nb in this['neighbor_tri']]
 neighbor_tri = _triangle_neighbors(this['tris'], this['np'])
 assert_true((np.array_equal(nt1, nt2) for (nt1, nt2) in zip(neighbor_tri, this['neighbor_tri'])))

@ testing . requires_testing_data def test_triangle_neighbors ( ) : this = read_source_spaces ( fname ) [ 0 ] this [ 'neighbor_tri' ] = [ list ( ) for _ in range ( this [ 'np' ] ) ] for p in range ( this [ 'ntri' ] ) : verts = this [ 'tris' ] [ p ] this [ 'neighbor_tri' ] [ verts [ 0 ] ] . append ( p ) this [ 'neighbor_tri' ] [ verts [ 1 ] ] . append ( p ) this [ 'neighbor_tri' ] [ verts [ 2 ] ] . append ( p ) this [ 'neighbor_tri' ] = [ np . array ( nb , int ) for nb in this [ 'neighbor_tri' ] ] neighbor_tri = _triangle_neighbors ( this [ 'tris' ] , this [ 'np' ] ) assert_true ( ( np . array_equal ( nt1 , nt2 ) for ( nt1 , nt2 ) in zip ( neighbor_tri , this [ 'neighbor_tri' ] ) ) )
test efficient vertex neighboring triangles for surfaces .