What is the behavior of 'polybool' with NaN-delimited Input?

1 view (last 30 days)
When I call polybool as follows, I get empty intersections, as expected:
[x,y]=polybool('&',...
[0,0,1,0],...
[0,1,0,0],...
[0,1,1,0],...
[1,1,0,1])
[x,y]=polybool('&',...
[0,1,1,0],...
[1,1,0,1],...
[0,0,1,0],...
[0,1,0,0])
When I combined the x & y inputs from both calls with a NaN in between, I expected the call to polybool to process the above computations in parallel.  Instead I got a nonempty intersection. 

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 5 Jan 2015
Although the documentation is not as clear, this is expected behavior.  When a polygon is represented as a Nan-delimited vector, the NaNs separate the contours of a single polygon.  An equivalent way of writing this would be to use a cell array containing vectors of the contour.

More Answers (0)

Tags

No tags entered yet.

Products


Release

R2013a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!