0001 function h = plot_pair_ch(parm, facefile, p)
0002
0003
0004
0005
0006
0007 [Xpath, Npath] = get_shortest_path(parm, facefile);
0008
0009
0010
0011
0012
0013 face = load(facefile);
0014 V = face.Vspm;
0015 F = face.F;
0016
0017 h = figure;
0018 vb_plot_surf(V,F);
0019 camlight headlight;
0020 view(p.angle);
0021 axis equal
0022
0023 hold on;
0024
0025
0026 Npair = length(Npath);
0027
0028 src_pos = zeros(Npair,3);
0029 det_pos = zeros(Npair,3);
0030 ch_pos = zeros(Npair,3);
0031
0032 for k=1:Npair
0033 Vpath = Xpath{k};
0034 NP = Npath(k);
0035
0036 src_pos(k,:) = Vpath(1,:);
0037 det_pos(k,:) = Vpath(end,:);
0038
0039 N1 = max(fix(NP/2),1);
0040 ch_pos(k,:) = Vpath(N1,:);
0041 end
0042
0043
0044 plot3(src_pos(:,1), src_pos(:,2), src_pos(:,3), p.Msend,'MarkerSize',p.Msize);
0045 plot3(det_pos(:,1), det_pos(:,2), det_pos(:,3), p.Mrecv,'MarkerSize',p.Msize);
0046
0047
0048
0049
0050
0051 for k=1:Npair
0052
0053 Vpath = Xpath{k};
0054 NP = Npath(k);
0055 N1 = max(fix(NP/2),1);
0056 ix1 = 1:N1;
0057 ix2 = N1:NP;
0058
0059 plot3(Vpath(ix1,1), Vpath(ix1,2), Vpath(ix1,3), p.Lsend);
0060 plot3(Vpath(ix2,1), Vpath(ix2,2), Vpath(ix2,3), p.Lrecv);
0061 end
0062