Brett Calcott venit, vidit, dixit 2006-04-03 07:34:
> Hi Gary,
> 
> Thanks for the help. That clears things up.
> 
> But I'm not sure it helps me do what I want. I want to connect up
> various closed shapes, circles ellipses etc. Basically, graph layout
> stuff, much like graphviz (www.graphviz.org).
> It isn't clear that box library is really set up to do this.

Right now it deals only with convex polygons, not more general convex
objects. Gary (with the help from the other Michael ;) ) showed you how
to convert a bounding box to a "convex polygon box". You can do this for
any bounding box, such as the bounding box of a canvas on which you
stroked a circle/ellipse/whatever. Of course, for a circle or ellipse
it's easier to determine the corners of the bounding box directly.


This rectangular box won't fit your non-rectangular object tightly; it
may be good enough for your connectors. If you want to do better: Any
convex object can be approximated by convex polygons. Again, for the
circle and ellipse you can do it easily (see, e.g., the box example in
the "misc" section http://pyx.sourceforge.net/examples/misc/index.html).
For a general bounding path you might be able to use the normpath elements.

In your original code snippet, note that text.text() returns a canvas
whereas path.circle() returns a path. Stroke the path on a canvas and go
from there.

Let us know in case you need more help (such as: less babble and more
code...).

Cheers,
Michael


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to