function bezier_surface_test02 ( )

%*****************************************************************************80
%
%% bezier_surface_test02() tests bezier_surface_neighbors().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    07 November 2006
%
%  Author:
%
%    John Burkardt
%
  rectangle_file_name = 'teapot_rectangles.txt';

  fprintf ( 1, '\n' );
  fprintf ( 1, 'bezier_surface_test02():\n' );
  fprintf ( 1, '  bezier_surface_neighbors() determines patch neighbors.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Note that, for this example, the teapot, there are\n' );
  fprintf ( 1, '  cases where more than two patches meet at a\n' );
  fprintf ( 1, '  (degenerate) side.  This routine will not handle\n' );
  fprintf ( 1, '  such cases completely.\n' );
%
%  Get the number of rectangles, allocate space for them, and read them in.
%
  fprintf ( 1, '  Read surface rectangle information from "%s"\n', ...
    rectangle_file_name );
  rectangle_node = load ( rectangle_file_name );
  rectangle_num = size ( rectangle_node, 1 );
  rectangle_dim = size ( rectangle_node, 2 );
  fprintf ( 1, '  There are %d surface rectangles\n', rectangle_num );
%
%  Compute and print the neighbor array.
%
  rectangle_neighbor = bezier_surface_neighbors ( rectangle_num, ...
    rectangle_node );

  i4mat_transpose_print ( 4, rectangle_num, rectangle_neighbor, ...
    '  Bezier patch neighbors:' );

  return
end
