-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdisplayShape.m
More file actions
32 lines (28 loc) · 864 Bytes
/
displayShape.m
File metadata and controls
32 lines (28 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% plot the shape, colored with annotations in case the annot input is
% indicated
function displayShape(shape,annot)
for k = 1:size(shape.triangles,1)
% Get the triangle coordinates
coord = [shape.points(shape.triangles(k,1),:) ;
shape.points(shape.triangles(k,2),:) ;
shape.points(shape.triangles(k,3),:)];
if nargin > 1
switch(annot(k))
case '0'
col = 'k';
case '1'
col = 'm';
case '2'
col = 'g';
case '3'
col = 'r';
end
fill(coord(:,1),coord(:,2),col,'EdgeColor','None');
else
fill(coord(:,1),coord(:,2),'w','EdgeColor','Black');
end
hold on;
end
axis equal
axis off
end