0

So I was wondering if there is a tool / similar to draw topological lines instead of straight lines on latex with points at their intersections? I was particularly looking to create this given image including the labels. enter image description here

New contributor
polygonlink1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
5
  • To follow up with my comments on your other questions, here you only have to draw your lines (say with Bezier curves), name the paths, then find the intersections between the paths, using intersections library. – SebGlav May 4 at 17:49
  • Would there exist an example of this somewhere? – polygonlink1 May 4 at 17:54
  • Do you actually want intersections marked, or do you want over/under? What you've drawn almost looks like a braid diagram, and there is a TikZ library for that. – Willie Wong May 4 at 17:55
  • please feel free to edit & reopen if the linked set of answers does not help. – Thruston May 4 at 18:02
  • Have you done a search on braid with LaTeX? – projetmbc 2 days ago
2

As for a starting point:

paths intersections

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{intersections}

\tikzset{dot/.style={circle,inner sep=1.5pt,fill=red}}

\begin{document}
    \begin{tikzpicture}
        \draw[name path=line1] (0,0) node[left] {line 1} .. controls ++(1,.5) and ++(-0.5,-2).. (3,0);
        \draw[name path=line2] (0,-1) node[left] {line 2} .. controls ++(1,-1) and ++(-1,1).. (3,1);
        \draw[name path=line3] (0,1) node[left] {line 3} .. controls ++(1,.5) and ++(-0.5,.5).. (3,-1);
        
        \path [name intersections={of=line1 and line2,by=A}];
        \path [name intersections={of=line1 and line3,by=B}];
        \path [name intersections={of=line2 and line3,by=C}];
        
        \foreach \p in {A,B,C}  \node[dot] at (\p) {};
    \end{tikzpicture}
\end{document}
0

You can try tikz-network package, which helps you drawing such paths using coordinates system, edges and vertices. (use bend for curves). Here is a simple example to start:

\documentclass{article}
\usepackage{tikz-network}
\begin{document}
\begin{tikzpicture}
\Vertex[x=0,y=0,NoLabel,color = black,size=.2]{a1}
\Vertex[x=0,y=2,NoLabel,color = black,size=.2]{a2}
\Vertex[x=3,y=1,NoLabel,color = black,size=.2]{c1}
\Vertex[x=6,y=0,NoLabel,color = black,size=.2]{b1}
\Vertex[x=6,y=2,NoLabel,color = black,size=.2]{b2}
\Edge[bend=-10](a1)(c1)
\Edge[bend=10](a2)(c1)
\Edge[bend=20](b1)(c1)
\Edge[bend=-20](b2)(c1)
\end{tikzpicture}
\end{document}
New contributor
Anna is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
3
  • Thanks for your input. It would be useful to post a complete compilable code instead of a snippet, thanks. Not tom ention the fact that the question was about curves and intersections. – SebGlav May 4 at 19:15
  • Hello and welcome. Your code does not compile. There is this error Package xkeyval Error: "nolabel" undefined in families "vertex". – AndréC May 4 at 19:57
  • Thank you for your comment, edited. – Anna May 4 at 20:01

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