Linie an der Schnittstelle mit Linie 2 brechen

Antwort erstellen


Diese Frage dient dazu, das automatisierte Versenden von Formularen durch Spam-Bots zu verhindern.
Smilies
:D :) :( :o :shock: :? 8) :lol: :-x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:

BBCode ist eingeschaltet
[img] ist eingeschaltet
[flash] ist ausgeschaltet
[url] ist eingeschaltet
Smilies sind eingeschaltet

Die letzten Beiträge des Themas

Ich habe die Datenschutzerklärung gelesen und bin damit einverstanden.

   

Wenn du eine Datei oder mehrere Dateien anhängen möchtest, gib die Details unten ein.

Ansicht erweitern Die letzten Beiträge des Themas: Linie an der Schnittstelle mit Linie 2 brechen

Re: Linie an der Schnittstelle mit Linie 2 brechen

von cis » Mi 5. Aug 2020, 12:08

Übermalen gefällt mir meistens nicht so sehr, ich würde es hier mit shorten machen:

5555555.png
5555555.png (7.18 KiB) 1306 mal betrachtet
\documentclass[tikz]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}}
\tikzset{edge/.style = {->,> = latex}}

\node[vertex] (M) at  (-10,0) {M}; 
\node[vertex] (N) at  (-6,0) {N};
\node[vertex] (PN) at (0,11) {PN};
\node[vertex] (Q) at  (0,6) {Q};

\path[edge,name path=L1] (N) -- (PN); 
\path[name path=L2] (M) |- (Q);

% Alt
%\fill [name intersections={of=L1 and L2,by=I},fill=red] (I) circle (.5cm); 

% Neu
\path[name intersections={of=L1 and L2,by=I},label=I]; 
\draw[red, shorten >=4mm] (N) -- (I); 
\draw[red, shorten <=4mm] (I) -- (PN); 

\draw[edge] (M) |- (Q);
\path (N) -- (I)  node[pos=.5,above,sloped] {Kartoffel};
\path (M) |- (I)  node[pos=.75,above] {Handball};
\end{tikzpicture}
\end{document}

PS: shorten kann mitunter auch problematisch sein, man kann auch echte Koordinaten vor und nach dem Schnittpunkt platzieren:

5555555.png
5555555.png (7.08 KiB) 1300 mal betrachtet
\documentclass[tikz]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}}
\tikzset{edge/.style = {->,> = latex}}

\node[vertex] (M) at  (-10,0) {M}; 
\node[vertex] (N) at  (-6,0) {N};
\node[vertex] (PN) at (0,11) {PN};
\node[vertex] (Q) at  (0,6) {Q};

\path[edge,name path=L1] (N) -- (PN); 
\path[name path=L2] (M) |- (Q);

% Alt
%\fill [name intersections={of=L1 and L2,by=I},fill=red] (I) circle (.5cm); 

% Neu 2
\path[name intersections={of=L1 and L2,by=I},label=I]; 
\path[] (N) -- (I) coordinate[pos=0.9](Ivor); 
\path[] (I) -- (PN)  coordinate[pos=0.1](Inach); ; 
\draw[blue] (N) -- (Ivor); 
\draw[blue] (Inach) -- (PN); 

\draw[edge] (M) |- (Q);
\path (N) -- (I)  node[pos=.5,above,sloped] {Kartoffel};
\path (M) |- (I)  node[pos=.75,above] {Handball};
\end{tikzpicture}
\end{document}

Re: Linie an der Schnittstelle mit Linie 2 brechen

von markusv » Mi 5. Aug 2020, 09:11

Hallo .

Anbei mein Vorschlag mit Hilfe der TikZ-Bibliothek intersections. Die "Lücke" erstelle ich mit einem gefüllten Kreis auf der Schnittstelle. Die Nodes werden automatisch mittig zwischen Knick und Schnittstelle bzw. (N) und Schnittstelle gesetzt:

\documentclass[tikz]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}}
\tikzset{edge/.style = {->,> = latex}}

\node[vertex] (M) at  (-10,0) {M}; 
\node[vertex] (N) at  (-6,0) {N};
\node[vertex] (PN) at (0,11) {PN};
\node[vertex] (Q) at  (0,6) {Q};

\draw[edge,name path=L1] (N) -- (PN); 
\path[name path=L2] (M) |- (Q);
\fill [name intersections={of=L1 and L2,by=I},fill=white] (I) circle (.5cm); 
\draw[edge] (M) |- (Q);
\path (N) -- (I)  node[pos=.5,above,sloped] {Kartoffel};
\path (M) |- (I)  node[pos=.75,above] {Handball};
\end{tikzpicture}
\end{document}

Linie an der Schnittstelle mit Linie 2 brechen

von Trauminsel » Mi 5. Aug 2020, 08:19

Guten Tag

Ihr könnt dem Minimalbeispiel entnehmen wie ich die Linie gebrochen habe, so da der zweite Pfeil an dieser Stelle passieren kann.

Die Lösung die ich gewählt habe ist aber "handgelenk mal pi" und sobald ich etwas an der Linie verändere die gebrochen werden muss ich auch die Bruchstelle manuel verändern.

Habt ihr einen Lösungsvorschlag, dass die Bruchstelle ebenfalls mitwandert wenn ich etwas verändere?


\documentclass[a4paper,11pt]{report}
\usepackage{tikz} 

\begin{document}


\begin{tikzpicture}

  \tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}}
    \tikzset{edge/.style = {->,> = latex}}


   \node[vertex] (M) at  (-10,0) {M}; 
    \node[vertex] (N) at  (-6,0) {N};
    \node[vertex] (PN) at (0,11) {PN};
    \node[vertex] (Q) at  (0,6) {Q};

 \path (N) -- (PN) coordinate [pos=0.5] (NPN1) {}; 
    \path (N) -- (PN) coordinate [pos=0.6] (NPN2) {}; 

 \coordinate  (CENN) at (-10,6) ;

\draw (N) to node[pos=0.5,above, sloped] {Kartoffel}  (NPN1);
\draw[edge] (NPN2) -- (PN);

\draw (M) -- (CENN);
\draw[edge] (CENN) to node[midway,above, sloped] {Handball}  (Q);

\end{tikzpicture}

\end{document}


Nach oben