From: Maurice L. <mj...@ga...> - 2003-08-24 18:47:27
|
Arjen Markus writes: > I have built a small function to plot (filled) circles via polygons and > I have noticed that the polygons are clipped by removing vertices that > fall > outside the viewport. The consequence is that large circles are no > longer > recognisable as circles. > > Is there a way out of this? The polygons should - in my opinion - be > drawn from all the vertices and the clipping should occur on the polygon > as a whole. Polygon clipping is fairly complex. The issue really raised its head when I implemented zooming in the plplot TK interface and started doing a lot of shade plotting, way back in '94 or so. I worked on it for a while before giving up due to lack of progress even though there were still a lot of problems with it. As an example, run "x16c -dev tk", zoom in on a section and then pan around. Anyway I decided to take another look at the code and noticed right away problems with the existing approach. Emboldened, I set about to improve it and now am happy to say it works much better than before. Grab the latest src/plline.c from cvs HEAD and see if the new code fixes your problem. Note it still does not work perfectly -- at a sufficiently high level of zooming we start to get clipping problems again. These I suspect are due to a fidelity problem, either in clipline() or somewhere else. Anyway no more time to work on it for now. -- Maurice LeBrun Lightspeed Semiconductor Corp |