Problems with fill, my object overlaps
12 views (last 30 days)
Show older comments
Hello,
I'm having a problem using the fill function, I have also tried using patch and get the same results.
Basically I'm plotting a path and I want the area I cover with the path to be one colour and the uncovered area another colour, pretty simple eh?
Well all goes well until the path overlaps it's self, then the overlapped area returns to the background colour producing a strange checkerbox type effect.
I have solved this but plotting sections of my path seperately however this adds to the computational time and I need this graph to be plotted in real time, so I would really appreciate if any one could other some advice.
I have the co-ords of left side on the path in a matrix "left" and the right side in "right", then I'm drawing the path to pint i using
fill([right(1,1);left(1:i,1)right((i+1)-(1:i),1)],[right(1,2);left(1:i,2)right((i+1)-(1:i),2)],'r');
I'm sure other people must have had this problem too, thanks very much in advance.
Gareth
1 Comment
Helena Hjørringgaard
on 18 May 2022
I know your post is very old, but did you ever manage to get it fixed? I have the same problem.
Answers (0)
See Also
Categories
Find more on Polygons in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!