Hello,

I tried to protect an area from being painted over. So I constructed
a clipping path out of two parts. The first part spans the whole
drawing picture (the rectangle in the following example), the
second part spans only the small protected area (arcn in the following
example). 


from pyx import *

c = canvas.canvas()

# drawing area
a = 5
cl = path.path(path.moveto(-a,-a),
               path.lineto(a,-a),
               path.lineto(a,a),
               path.lineto(-a,a),
               path.closepath())

# protected area
cl.append(path.arcn(0,0,2,360,0))

#c.stroke(cl)   # <-- clipping path

c.insert(canvas.clip(cl))
c.stroke(path.line(-2,3,2,-3),[style.linewidth(1)])

c.writeEPSfile("foo")



The thick line is clipped as intended, but the thin line shouldn't
exist at all. I know that the clipping path is chosen unfortunately,
because the connection line between the rectangle and the circle
crosses the circle. But it is very complex to prevent this crossing
if the protected area may have an arbitrary shape and is provided by
some other user and not me.

What's the recommended way to this kind of clipping? How to get
rid of the small line?


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

Reply via email to