Linienbeschneidung im Pfadbild vermeiden

Linienbeschneidung im Pfadbild vermeiden

Ich definiere einen Knotenstil Hostwie folgt (entschuldigen Sie die deutschen Bezeichnungen):

\tikzset{Host/.style={path picture={%
  \coordinate (hinten links oben) at ($(path picture bounding box.north west)!0.33!(path picture bounding box.north east)$);
  \coordinate (hp1) at ($(path picture bounding box.north west)!0.66!(path picture bounding box.north east)$);
  \coordinate (vorne links oben) at ($(path picture bounding box.south west)!0.66!(path picture bounding box.north west)$);
  \coordinate (vorne rechts unten) at ($(path picture bounding box.south west)!0.66!(path picture bounding box.south east)$);
  \coordinate (vorne rechts oben) at ($(vorne rechts unten)!0.66!(hp1)$);
  \coordinate (hinten rechts unten) at ($(path picture bounding box.south east)!0.33!(path picture bounding box.north east)$);
  \path (vorne links oben) edge [-] (hinten links oben);
  \path (hinten links oben) edge [-] (path picture bounding box.north east);
  \path (path picture bounding box.north east) edge [-] (hinten rechts unten);
  \path (hinten rechts unten) edge [-] (vorne rechts unten);
  \path (vorne rechts unten) edge [-] (path picture bounding box.south west);
  \path (path picture bounding box.south west) edge [-] (vorne links oben);
  \path (vorne links oben) edge [-] (vorne rechts oben);
  \path (vorne rechts oben) edge (path picture bounding box.north east) edge (vorne rechts unten);
}},minimum width=2em, minimum height=3em}

Wenn ich diesen Stil verwende, erscheinen die Linien entlang der Ränder des Begrenzungsrahmens optisch dünner. Ich denke, das liegt daran, dass die Linien um ihre Endpunkte herum „wachsen“ und somit vom Begrenzungsrahmen abgeschnitten werden.

Gibt es eine einfache Möglichkeit, eine Art Rand einzufügen?

Antwort1

Als schnelle Lösung verschieben Sie einfach Ihre aktuelle Linienbreite innerhalb des Begrenzungsrahmens des Pfadbilds, um ein Abschneiden zu vermeiden.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\tikzset{Host/.style={path picture={%
\coordinate (ppbbnw) at ([shift={(.5\pgflinewidth,-.5\pgflinewidth)}]path picture bounding box.north west);
\coordinate (ppbbne) at ([shift={(-.5\pgflinewidth,-.5\pgflinewidth)}]path picture bounding box.north east);
\coordinate (ppbbsw) at ([shift={(.5\pgflinewidth,.5\pgflinewidth)}]path picture bounding box.south west);
\coordinate (ppbbse) at ([shift={(-.5\pgflinewidth,.5\pgflinewidth)}]path picture bounding box.south east);
\coordinate (hlo) at ($(ppbbnw)!{1/3}!(ppbbne)$);
\coordinate (hp1) at ($(ppbbnw)!{2/3}!(ppbbne)$);
\coordinate (vlo) at ($(ppbbsw)!{2/3}!(ppbbnw)$);
\coordinate (vru) at ($(ppbbsw)!{2/3}!(ppbbse)$);
\coordinate (vro) at ($(vru)!{2/3}!(hp1)$);
\coordinate (hru) at ($(ppbbse)!{1/3}!(ppbbne)$);
\draw (ppbbne) -- (hru) -- (vru) -- (ppbbsw) -- (vlo) -- (hlo) -- cycle;
\draw (vlo) --(vro) -- (ppbbne) (vro) -- (vru);
}
},minimum width=2em, minimum height=3em}

\node[Host,thick] {};
\node[Host,ultra thin] at (1,0) {};
\node[Host] at (2,0) {};
\end{tikzpicture}
\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen