Increasing thickness a portion of the circle's boundary in tikz

Easiest if you know the angles:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[-] (2,0) circle (1.5);
%draw darkened arc from (0.58,-0.5) to (3.45,0.3)
\draw [very thick] (2,0) ++(210:1.5) arc[start angle=210,delta angle=-150,radius=1.5];
\end{tikzpicture}
\end{document}

Though they can be calculated:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\coordinate (o) at (2,0);
\draw[-] (o) circle (1.5);
\coordinate (s1) at (0.58,-0.5);
\coordinate (s2) at (3.45,0.3);
\draw [very thick] 
let
\p1=(o), \p2=(s1),\p3=(s2),\n1={atan2(\y2-\y1,\x2-\x1)},\n2={atan2(\y3-\y1,\x3-\x1)}
in
(o) ++(\n1:1.5) arc[start angle=\n1,end angle=\n2,radius=1.5];

\draw [very thick,red] 
let
\p1=(o), \p2=(s1),\p3=(s2),
\n1={ifthenelse(atan2(\y2-\y1,\x2-\x1)<0,atan2(\y2-\y1,\x2-\x1)+360,atan2(\y2-\y1,\x2-\x1))},
\n2={ifthenelse(atan2(\y3-\y1,\x3-\x1)<0,atan2(\y3-\y1,\x3-\x1)+360,atan2(\y3-\y1,\x3-\x1))}
in
(o) ++(\n1:1.5) arc[start angle=\n1,delta angle=\n2-\n1,radius=1.5];

\end{tikzpicture}
\end{document}

enter image description here

So that doesn't seem to work perfectly in all cases. However, when using the second option, you can just subtract 360 from the delta angle to draw the arc the other way, i.e. delta angle=\n2-\n1-360.

\documentclass[border=4mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\coordinate (o) at (2,0);
\draw[-] (o) circle (1.5);
\coordinate (s1) at (2,-1.5);
\coordinate (s2) at (3.4,-0.5);
\draw [very thick] 
let
\p1=(o), \p2=(s1),\p3=(s2),\n1={atan2(\y2-\y1,\x2-\x1)},\n2={atan2(\y3-\y1,\x3-\x1)}
in
(o) ++(\n1:1.5) arc[start angle=\n1,end angle=\n2,radius=1.5];

\draw [very thick,red] 
let
\p1=(o), \p2=(s1),\p3=(s2),
\n1={ifthenelse(atan2(\y2-\y1,\x2-\x1)<0,atan2(\y2-\y1,\x2-\x1)+360,atan2(\y2-\y1,\x2-\x1))},
\n2={ifthenelse(atan2(\y3-\y1,\x3-\x1)<0,atan2(\y3-\y1,\x3-\x1)+360,atan2(\y3-\y1,\x3-\x1))}
in
(o) ++(\n1:1.5) arc[start angle=\n1,delta angle=\n2-\n1-360,radius=1.5];

\end{tikzpicture}
\end{document}

enter image description here


Clipping is another easy option.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\coordinate (a) at (0.58,-.5);
\coordinate (b) at (3.45,0.3);
\draw[-] (2,0) circle (1.5);
\draw (a) circle (0.1);
\draw (b) circle (0.1);
\begin{scope}
    \clip (a) -- (b) -- ++(80:1.5) -- ++(180:4) -- cycle;
    \draw[very thick,red] (2,0) circle (1.5);
\end{scope}
%draw darkened arc from (0.58,-0.5) to (3.45,0.3)
\end{tikzpicture}
\end{figure}
\end{document}

enter image description here

Tags:

Tikz Pgf