function t2 = triangle_snap ( t )

%*****************************************************************************80
%
%% triangle_snap() "snaps" a polyiamond described by its triangle list.
%
%  Discussion:
%
%    We "snap" a polyiamond by translating it so that its least I and
%    least J node coordinates are 0.
%
%    The triangle list is a list of the IJK parallelogram triangles
%    that constitute the polyiamond.
%    If k = 0, the "ijk" triangle has vertices
%      (i-1,j-1), (i,j-1), (i-1,j).
%    If k = 1, the "ijk" triangle has vertices
%      (i,j), (i-1,j), (i,j-1).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 November 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer T(TN,3): the triangle list. 
%
%  Output:
%
%    integer T2(TN,3): the triangle list after snapping.
%
  [ imin, imax, jmin, jmax ] = triangle_range ( t );

  t2 = zeros ( size ( t ) );

  t2(:,1) = t(:,1) - imin;
  t2(:,2) = t(:,2) - jmin;
  t2(:,3) = t(:,3);

  return
end

