1

Looking at the pgfmanual section 47.4.9 at the shape of the make contact... I'm having trouble understanding the point/use of the input- and output anchors.

The input and output anchors are placed exactly where the east and west anchors are, which means they are not where the line should enter or exit the contact. Evidently the shape is drawn correctly regardless:

\begin{tikzpicture}[circuit ee IEC]
    \node [contact] (contact 1) at (0,0) {};
    \node [contact] (contact 2) at (0,2) {};
    \draw (contact 1) to [make contact] (contact 2)
\end{tikzpicture}

Do the input and output anchors have any use for this component? And exactly how does the to function determine where to place the shape?

  • Your path is vertical so the shape is rotated accordingly. And to path accepts pos argument so it acts like a regular node. See mark connection node decoration for a similar application – percusse Mar 4 '15 at 8:47
  • I get the part about the rotation; that was not my point. Sorry if I was unclear. My point is that the line from contact 1 does not connect to the make contacts input anchor. Evidently that anchor is not part of the positioning, and I wonder why. Also I wonder what is part of the positioning. – ravnsgaard Mar 4 '15 at 8:52
  • Input anchor and west anchor as far as I can see from the code is the same point. Both inherit from rectangle shape but I don't know why they bothered to redefine the input anchor. For positioning a contact with west anchor is pretty useless don't you think? Southwest anchor would be much appropriate – percusse Mar 4 '15 at 9:05
  • My point exactly. My question is, how does TikZ determine which anchor (if any) to use. Or does it do something completely different. I doubt it guesses... – ravnsgaard Mar 4 '15 at 9:13
  • Ah OK now I get it. No it doesn't guess (actually one thing I've learned over the years is that in TeX nothing is guessed). That is defined by the to path [make contact] and the style circuit symbol size – percusse Mar 4 '15 at 9:24
1

OK, I figured it out. The relevant anchor that the to function uses is neither input nor output but the anchorborder, which is actually based on the center anchor.

The relevant sections of the pgfmanual is 102.5.3 for the description of \anchorborder and 97.5.3 for \pgfpointborderrectangle, which \anchorborder typically uses.

I guess I learned something. Thanks percusse for the comments. They pointed me in the right direction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.