Skip to content

Commit

Permalink
Merge branch 'Projection' of https://github.com/CHLNDDEV/OceanMesh2D
Browse files Browse the repository at this point in the history
…into Projection
  • Loading branch information
WPringle committed Feb 8, 2019
2 parents 6d99795 + 5f84472 commit 619cf41
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions @meshgen/private/dpoly.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,24 @@
inpoly_flip = obj.inpoly_flip{box_num};
bbox = obj.bbox{box_num};
if box_num > 1
inside = (p(:,1) >= bbox(1,1) & p(:,1) <= bbox(1,2) & ...
p(:,2) >= bbox(2,1) & p(:,2) <= bbox(2,2) );
pt=obj.boubox{box_num};
ee=Get_poly_edges(pt);
inside = inpoly(p,pt,ee) ;
clearvars pt ee
%inside = (p(:,1) >= bbox(1,1) & p(:,1) <= bbox(1,2) & ...
% p(:,2) >= bbox(2,1) & p(:,2) <= bbox(2,2) );
else
inside = true(size(d));
end
for bn = box_num+1:length(obj.bbox)
% Get all points inside inner boxes
inside2 = (p(:,1) >= obj.bbox{bn}(1,1) & ...
p(:,1) <= obj.bbox{bn}(1,2) & ...
p(:,2) >= obj.bbox{bn}(2,1) & ...
p(:,2) <= obj.bbox{bn}(2,2) );
pt=obj.boubox{bn};
ee=Get_poly_edges(pt);
inside2 = inpoly(p,pt,ee) ;
% inside2 = (p(:,1) >= obj.bbox{bn}(1,1) & ...
% p(:,1) <= obj.bbox{bn}(1,2) & ...
% p(:,2) >= obj.bbox{bn}(2,1) & ...
% p(:,2) <= obj.bbox{bn}(2,2) );
inside(inside2) = false;
end
end
Expand Down

0 comments on commit 619cf41

Please sign in to comment.