From: Michael Schindler <mschindler@us...>  20050914 22:36:25

Hello Rich, On 14.09.05, Rich Drewes wrote: > I'm having a lot of trouble getting absangle1= and absangle2= on curve()s > to do what I expect. This may be because what I expect it to do is not > what it is supposed to dothe documentation is a bit brief on what they > do. > > What I *think* absangle is supposed to do is define the absolute angle of > entry of my connector curve into the object being connected to. In my > case, I am connecting polygons, mostly just boxes. So absangle2=0 would > mean that my arrow would enter the target from the left (or maybe the > right, wherever 0 is defined . . . already things are a bit hazy). If > absangle2=90 the target would be entered from the top of the object (or > maybe bottom, depending on which direction things are counted.) > > (Or, rather than connecting to the edge of the target at the angle given > by the side, does it merely instruct the curve drawer to connect to some > convenient side of the target, but connect to it at the indicated angle of > incidence?) When giving the orientation angle, I always think in terms of the tangent vector of the path (heading in the direction that the path is drawn: along positive parameterization). The coordinate system is such that an angle of 0 degrees means "heading right" and 90 degrees means "heading top" Therefore, if you want something like this: _ _ _ > _ then use absangle1=0, absangle2=0 _______ / \    v _ _ then use absangle1=90, absangle2=90 and so on. For the relative angles, things are different. Here, I try to be consistent with the arc() connector, where both relative angles are the same. Therefore, the coordinate systems at the two boxes have different signs. The absolute values of relangle1 and relangle2 are the (absolute) angles between the connector and the straight connection line between the box centers. Their sign gives the side on which they start: When they have the same sign, the whole connectors stays on the same side. I admit that there are many different coordinate systems for these angles. Maybe we should turn the sign of relangle2. This is a point that can be discussed. > The absangle arguments seem to have more effect when my polygons are > smaller. If my polygons are more elongated, my absangle commands seem to > be ignored consistently by whatever actually placed my connector curves. In order to convince me that something strange happens, please enclose a short example. This is what the connectors do: 1. draw a line/curve/arc from one boxcenter to the other boxcenter The centers are the important orientation points for connectors. If you are using textboxes, then the center will be on the baseline of the text, at the leftmost point (unless you use text.halign.xxx) 2. intersect this line/curve/arc with the box' outline path (polygons in your case) 3. shorten the line/curve/arc according to the boxdists parameter Note that all angles are evaluated at the box' center. This means that when you connect a pair of boxes, first large boxes, and then small ones, and then compare, the global slopes of the two connectors will be the same, but the angle at the different box' outlines will, of course, be different. > See http://www.interstice.com/drewes/brain/pyxdocexample.eps for an > example of what I am trying to do. As you can see, I have to be pretty > careful about how the connectors are placed to make sure the result is > legible. > I suspect I am working under at least one major misconception here. I hope my explanations are helpful, and I will improve the documentation at this point. Michael.  "A mathematician is a device for turning coffee into theorems" Paul Erdös. 