|
From: Andre W. <wo...@us...> - 2004-12-06 22:40:59
|
Hi Peter, On 30.11.04, Peter Falloon wrote: > Thanks for that, everything works again now! Meanwhile, I hate to > bother you again, but I've decided to try and create a set of feynman > diagrams (of the kind used to calculate weak localization etc, i.e. > cooperons and diffusons and so on). I think ultimately getting a good > set of diagrams would be a very useful application of pyx. The first > step is to create an oval-shaped curve. I've been looking but I don't > see a simple way to do this. Ideally, there would be an optional extra > argument to circle which would allow to elongate along x or y axis. The > other option, which seems much less elegant, is to perform a linear > transformation on the circle, but this doesn't seem to work. Is there a > simple way to generate an oval? No. Its actually what PostScript offers (IIRC). If you want to draw an elipse, you have to transform a circle. However, you can also use bezier curves to nicely build those kind of shapes. > Finally, the diagrams have wiggly lines (roughly sinusoidal) attached > at either end to represent the velocity operator. It would be great if > there were a "deformer" which give a wiggly line instead of a cycloid. > Are there plans to extend the "deformer" functions in the future? (I basically do know how feynman diagrams look like and I even do understand in principle what they stand for -- thanks to Gert!) There are several things to be addressed here. You want to connect nodes. This is something you could make use of connectors. Those nodes are called boxes in the (current) language of PyX. These are graphical objects with a border, where we currently have a limitation to polygons but this is subject of change for the future (i.e. circles and the like should become possible in the future). As soon as you have connection lines, you could take advantage of deformers to create those wiggled lines. (It actually funny, that the cycloid, as we have it now, was originally a replacement for a wiggler (which I mistakeably called wriggler in my implementation) I wrote almost a year ago. It was more or less a design test and an example of what kind of path operations I had in mind that time. I was concentrating on a spring-like design as the real cycloid does it now as well.) The wiggler deformer, as you would like to have it, should be a different deformer than the cycloid. I think its not a good idea to build one huge and complicated deformer which is a huge collection of all kind of strange deform operations. Instead, we should have several small and handy deformers (also in terms of there parameter list), which OTOH could share some code by inheritance between each other. There's another thing worth some thoughts in the design phase of such a "framework" for feynman diagrams. Stroking arrows at the paths (at the end or in the middle of a path) should be straight forward. Such an arrow would be a decorator, not a deformer, by the way. But what I would take care of from the very beginning are those double lines. I'm not totally sure how those should be created starting from a connecting path in the beginning. Should we start to have two paths for that case. I don't think so ... but I do not have strong arguments at hand. Since Michael has spend quite some time in writing the connectors and the cycloid deformer, we might get him (and possibly others) included in the discussion. Thus I'm just cross-posting this answer to pyx-devel. Take it into account when answering, that Peter might not (yet ;-)) be a subscriber of pyx-devel ... André -- by _ _ _ Dr. André Wobst / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript figures with Python & TeX (_/ \_)_/\_/ visit http://pyx.sourceforge.net/ |