-
Notifications
You must be signed in to change notification settings - Fork 0
/
prototype3.m
44 lines (36 loc) · 1.19 KB
/
prototype3.m
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
33
34
35
36
37
38
39
40
41
42
43
44
% Prototype 3
set(0,'DefaultFigureWindowStyle','docked')
close all
clear
manifold = {};
edgesToCheck = {};
addpath(genpath(fullfile(fileparts(mfilename),'geom3d')))
%% Add obstacles (and start/end)
addObstacles4
%% Begin algorithm
[manifold, edgesToCheck] = extendEdgeTowardGoal(startPoint, endPoint, [], vertices,...
edges, faces, manifold, edgesToCheck, []);
% h = gca;
% figure;f = gca;drawRemainingEdges(edgesToCheck,1)
% axes(h)
count = 1;
while size(edgesToCheck,1)>=count
if length(edgesToCheck(count,:)) == 2
faceOrder = [];
else
faceOrder = edgesToCheck{count,3};
end
% Display edge
% tempH = drawEdge3d([edgesToCheck{count,1}(1,:),edgesToCheck{count,1}(2,:)],'color','yellow', 'linewidth',8);
% tempH.delete;
[manifold, edgesToCheck] = extendEdgeTowardGoal(edgesToCheck{count,1},...
endPoint, edgesToCheck{count,2}, vertices, edges, faces, manifold,...
edgesToCheck, faceOrder);
count = count+1;
edgesToCheck = removeDuplicates(edgesToCheck,count);
% axes(f)
% cla
% drawRemainingEdges(edgesToCheck,count)
% axes(h)
disp(['count: ', num2str(count),', edgesToCheck: ',num2str(length(edgesToCheck))])
end