function [supernodes,edges] = hole(center,rad,degrees,inc); % % function [supernodes,edges] = hole(center,rad,degrees); % % Input: % center = x & y coordinates of hole center % rad = radius of hold % degrees = number of degrees between supernodes (default 30) % inc = increment to add to supernode numbers (default 0) % Output: % supernodes = list of points on the hole circumference % edges = list of edges defining the hole % error(nargchk(2,4,nargin)); if nargin==2 degrees = 30; end if nargin < 4 inc = 0; end theta = (0:degrees:(360-degrees))*pi/180; theta = theta(:); xc = center(1); yc = center(2); supernodes = [xc+rad*cos(theta) yc+rad*sin(theta)]; ns = length(supernodes); edges = [1:ns ; [2:ns 1]]'; edges(end,2) = 1; edges = edges + inc;