Skip to content
Snippets Groups Projects
Commit 50d2c171 authored by Ivar Stefansson's avatar Ivar Stefansson
Browse files

Update area_on_face.m for special of no intersection area.

parent 2a15ffa9
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ for i = 1:NVertices ...@@ -24,7 +24,7 @@ for i = 1:NVertices
allOneSide(i) = all(northWest(:,i)) || all(~northWest(:,i)); allOneSide(i) = all(northWest(:,i)) || all(~northWest(:,i));
end end
% [nw(:,N),on(:,N)] = check_points(pol,a,b,isv); % hva med p linje?? % [nw(:,N),on(:,N)] = check_points(pol,a,b,isv); % hva med på linje??
% alloneside(N) = all(nw(:,N)) || all(~nw(:,N)); % alloneside(N) = all(nw(:,N)) || all(~nw(:,N));
...@@ -65,5 +65,14 @@ end ...@@ -65,5 +65,14 @@ end
inside = inpolygon(polygon(:,1),polygon(:,2),Polygon(:,1),Polygon(:,2)); inside = inpolygon(polygon(:,1),polygon(:,2),Polygon(:,1),Polygon(:,2));
insidePoints = polygon(inside,:); insidePoints = polygon(inside,:);
[~, a] = convhull([intersections(1:j,:);insidePoints]); try
[~, a] = convhull([intersections(1:j,:);insidePoints]);
catch
% The exception should only occur if the intersection is empty. Displays the polygons
% for the user to inspect.
disp('Returned zero intersection area for coarse and fine polygons')
disp(Polygon)
disp(polygon)
a = 0;
end
end end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment