You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: intersect_plane.m
    path of file: ./repos/bspm/thirdparty/spm12/external/fieldtrip/plotting/private
    
    the code of the file until where you have to start completion: function [X, Y, Z, pnt1, tri1, pnt2, tri2] = intersect_plane(pnt, tri, v1, v2, v3)

% INTERSECT_PLANE intersection between a triangulated surface and a plane
% it returns the coordinates of the vertices which form a contour

% % Use as
%   [X, Y, Z] = intersect_plane(pnt, tri, v1, v2, v3)
%
% where the intersecting plane is spanned by the vertices v1, v2, v3
% and the return values are each Nx2 for the N line segments.

    
function [X, Y, Z, pnt1, tri1, pnt2, tri2] = intersect_plane(pnt, tri, v1, v2, v3)

% INTERSECT_PLANE intersection between a triangulated surface and a plane
% it returns the coordinates of the vertices which form a contour

% % Use as
%   [X, Y, Z] = intersect_plane(pnt, tri, v1, v2, v3)
%
% where the intersecting plane is spanned by the vertices v1, v2, v3
% and the return values are each Nx2 for the N line segments.

% Copyright (C) 2002-2012, Robert Oostenveld
%
% $Id$

npnt = size(pnt,1);
ntri = size(tri,1);
% side = zeros(npnt,1);
% for i=1:npnt
%   side(i) = ptriside(v1, v2, v3, pnt(i,:));
% end