Maurice LeBrun wrote:
> Arjen Markus writes:
> > Hello,
> > One of our clients ran into a problem with filling polygons with
> > many vertices: PLplot has a limit of 256 vertices per polygon and
> > in this case the polygon may have many more.
> > I can of course increase the limit to any number I like, or
> > make it dynamic. But I want to know if the reason for this
> > limit is more than just a convenience (it allows one to use
> > simple arrays for instance).
> It was just a shortcut at the time. Feel free to make it dynamic as that
> would certainly be an improvement. It looks like all the following files
> are affected:
> ged$ find . -path \*.c |xargs fgrep PL_MAXPOLY | cut -f 1 -d : |uniq
I am working on making it dynamic, it seems the most elegant solution.
But I ran into a small bug in c_plfill:
If the number of vertices (n) exceeds PL_MAXPOLY-1, then n is set to
A bit further down, it is checked if the polygon is closed. If not:
xpoly[n-1] = ...
ypoly[n-1] = ...
So, at this moment n has the value PL_MAXPOLY+1!
This was no (visible) problem, because the device drivers would stop
the program, but I ran into it in my first (and completely insufficient)
> > A good reason I can think of is that it is a safe limit for
> > all drivers. In that case, I would have to look for other
> > solutions.
> Good question. I just checked the man page for XFillPolygon and see no limit.
> Would be a good idea to check for all major drivers, like ps, jpeg, etc.