Joerg Lehmann wrote:
> On 05.05.08, Andreas Matthias wrote:
>> In the following example path `p' should be clipped by the
>> `clip' path, but `p' is missing as a whole. However, `p'
>> appears again if I delete one or two of the path.moveto
>> commands marked by <== in the `clip' path. What's going
>> on here? Why do these path.moveto commands disrupt the
>> clipping?
>>
>> from pyx import *
>>
>> clip = path.path(
>> path.moveto(0,0),
>> path.lineto(3,0),
>> path.moveto(3,0),# <==
>> path.lineto(3,3),
>> path.moveto(3,3),# <==
>> path.lineto(0,3),
>> path.lineto(0,0)
>> )
> [snip]
>
> This is actually more a Postscript question than a PyX one.
> Anyway, the moveto implicitely closes the current subpath, i.e. it adds a
> straight line from the last point of this subpath to its first one.
> Afterwards, a new subpath is started from the point given as argument to
> the moveto statement.
>
> In your case, the current subpath is just a simple straight line
> and closing it, for a clipping operation, just gives the degenerate
> situation of clipping region of zero area.
Oh, I see. Thanks.
Is there a way to remove these moveto commands? What should I do
if I want to construct the clipping path by appending several
individual paths?
clip1 = path.path(
path.moveto(0,0),
path.lineto(3,0))
clip2 = path.path(
path.moveto(3,0),
path.lineto(3,3))
clip3 = path.path(
path.moveto(3,3),
path.lineto(0,3))
clip4 = path.path(
path.moveto(0,3),
path.lineto(0,0))
clip = clip1+clip2+clip3+clip4
Now path `clip' contains these unwanted moveto commands. But how
to remove them?
Ciao
Andreas
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user