Re: a workaround for large EPS files from ContourPlot
- To: mathgroup at smc.vnet.net
- Subject: [mg87459] Re: a workaround for large EPS files from ContourPlot
- From: "mikelito at gmail.com" <mikelito at gmail.com>
- Date: Fri, 11 Apr 2008 01:42:59 -0400 (EDT)
- References: <fti3ub$ogo$1@smc.vnet.net> <ftkb7q$aa5$1@smc.vnet.net>
Dear Will, I looked more in-depth at tour code. It is definitely cleaner than mine :-). I think I understood both why your code is faster, and why it fails sometimes. I still have to come out with a solution, merging the best of the two approaches. What you do is breaking the polygons into segments, then deleting all the segments which appear more than once, then build back a closed contour. What I do is working on the polygons, merging any *couple of polygons* having a side in common. Of course this makes the pattern matching more complicated, hence the slowdown. If you look at a complicated plot simplifyed by my algorithm, and plot it prepending an EdgeForm directive so as to show the boundaries of the polygons, you'll notice that shapes with holes are in fact closed polygon, as there are always "creeps" connecting the outside to the inner holes. In this way, arbitrarily complicated shapes can be simplified withoud losing the holes. I don't know how this can be done with yout "break and rebuild" approach. I'll think to it, and in any case I'll try to make my code look more similar to yours :D. After all, I don't care too much about speed: when I need graphics for publication I can very well wait one night for simplifying and exporting. The guys at Wolfram should have much easier life, as I think we are basically trying to undo a recursive refinement they are doing themselves. After all, they just could revert to Math05 code, which was doing a pretty good job! anyway, I'll work on this and send you updates. can I use your private address, or do you know ho I can add attachments to these posts? Best regards michele