TikZ coding: How to create space between polygon and the nodes it surrounds?
Question
I'm using TikX with LaTeX to draw a technical diagram. I'm trying to draw an irregular polygon around a group of named nodes in a tree. I've gotten as far as
\draw [rounded corners, thick]
(node cs:name=add,anchor=north) --
(node cs:name=cvc,anchor=west) --
(node cs:name=addrc,angle=200) --
(node cs:name=addrc,angle=-20) --
(node cs:name=cnst,anchor=east) --
cycle;
But the polygon is too close to the nodes. How can I either enlarge the polygon or specify better coordinates to get a diagram where there is some separation between the polygon and the nodes it surrounds?
Solution
One trick you could try is to make a new invisible "fake" nodes in the same locations as the original nodes. You can then play with the outer sep=10pt
property for these nodes.
(This avoids these changes affecting the rest of the picture).
\node at (cvc) [name=fakecvc,outer sep=10pt,inner sep=5pt]{};
Then draw your polygon around these bigger "fake" nodes.
(maybe increasing the roundness will help? rounded corners=20pt
)
Sometimes its also useful to manually transform points
\usetikzlibrary{calc}
($(node cs:name=d,anchor=north)+(-10pt,+5pt)$)