-
Notifications
You must be signed in to change notification settings - Fork 8
/
FindWalls.m
30 lines (27 loc) · 899 Bytes
/
FindWalls.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
function [walls,polygons,centerLonLat] = FindWalls(filename)
% -----------------------------------------------------
% -- Fast mmWave Ray Tracing Simulator (v0.2)
% -- 2018 (c) junquan.deng@aalto.fi
% -----------------------------------------------------
index = 0;
[buildings,centerLonLat] = buildingFootprint(filename);
walls = cell(length(buildings)*20,1);
polygons = cell(length(buildings),1);
for i = 1:length(buildings)
polygon = buildings{i};
xs = zeros(length(polygon),1);
ys = zeros(length(polygon),1);
for j = 1:length(polygon)-1
index=index+1;
walls{index}.p1 = polygon(j,:);
walls{index}.p2 = polygon(j+1,:);
xs(j) = polygon(j,1);
ys(j) = polygon(j,2);
end
xs(end) = polygon(1,1);
ys(end) = polygon(1,2);
polygons{i}.xs = xs;
polygons{i}.ys = ys;
end
walls(index+1:end)=[];
end