Hi again
I just found a bug in plP_plfclp.

I hit a scenario where during a plshades call, my whole window (including
outside the x and y limits of the data) got filled with one of the colours.
I've traced this to plP_plfclp, the drawable variable and notpointinpolygon.

What happens is that, while filling one polygon the bottom left corner gets
incorrectly assigned as inside the polygon and drawable gets incorrectly
assigned as false. This results in plP_plfclp thinking that the polygon
encircles the whole plot window and the plot window gets filled with the
colour.

I haven't had chance to check why drawable ends up as false, however, the
error in notpointinpolygon comes from notcrossed returning
PL_NEAR_PARALLEL. notpointinparallel doesn't deal with this special return
value and instead treats it as returning true. In this particular case, it
should be returning false and so everything goes wrong.

I suggest a couple of fixes.

in notpointinpolygon, we should check if the point is outside the polygon
bounding box. This will catch many of the near parallel cases.

For the reminder we then need a better way to find a point to do the ray
tracing or to catch the special codes and then choose another point. This
is easier to do when we know the point is close to the polygon, because
then moving our ray tracing point has a bigger effect. We can also afford
to do some more complicated maths here because almost all cases will be
picked up by the bounding box case.

I'll work on this a bit today and send round a patch for people to review
if they wish before committing.

Thanks

Phil
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to