John Hunter wrote:
> On 7/12/07, Michael Droettboom <[EMAIL PROTECTED]> wrote:
> 
>> It looks like that the backend API isn't really set up to do compound
>> paths.  The PolygonCollection class appears to be just a list of simple
>> polygons, rather than something that could be used for compound paths.
>> (Correct me if I'm wrong.)  Is the only reason for wanting branch cuts
>> in contours because matplotlib doesn't support compound paths?  Is there
>> a reason matplotlib doesn't support compound paths?  I suspect you guys
>> have been down that "path" [haha] already.  I would anticipate problems
>> if different backends have different winding rules, but perhaps there
>> are some ways to around that?  This could be useful in general in
>> matplotlib...
> 
> Actually we haven't.  In fact, paths have been a fairly recent
> addition to mpl.  The drawing model is based on GTK, which did not
> have paths at the time.  The renderer API is basically the GTK API,
> and all the other backends simply implement the GTK drawing model.  In
> the early days, there was only a GTK backend....
> 
> So one reason why the backends are a bit of a kludge is because we
> have tried to throw some extra stuff into the GTK drawing model as an
> afterthough.  We could redo all the collection stuff w/ compounds
> paths.

This is the sort of thing I was getting at by suggesting that if a big 
project is possible, rethinking the drawing model and refactoring 
accordingly would be a candidate.  I think there is quite a bit of scope 
for fundamentally improving mpl internals (and maybe even performance), 
and reducing future maintenance costs, by doing this.  It is at the same 
level as, and maybe complementary to, redoing the transforms framework.

With respect to contouring, yes, a branch cut is a kludge--a way to fake 
a compound path.  It would be much cleaner if the cuts could be 
eliminated.  With a little extra record-keeping to mark the parts of 
paths that bound masked regions and boundaries, this would also solve 
the problem that the polygon boundaries don't always coincide with the 
contour lines that are calculated with cntr.c in non-filled mode.

Eric

> 
> JDH


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to