Segment marks with round caps

Use decorations.markings to customize the markings as you like.

To control the distance between the two ticks, just modify the x coordinates here:

\draw[line cap=round, thick] (-2pt,-2pt) -- (-2pt,2pt);
\draw[line cap=round, thick] (2pt,-2pt) -- (2pt,2pt);

MWE:

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[decoration={
markings,
mark=at position .5 with
{
\draw[line cap=round, thick] (-2pt,-2pt) -- (-2pt,2pt);
\draw[line cap=round, thick] (2pt,-2pt) -- (2pt,2pt);
}
}
]
    \coordinate (A) at (0,0);
    \coordinate (B) at (2,4);
    \coordinate (C) at (4,0);

    \draw(A)--(B)--(C)--cycle;
    \path[postaction={decorate}] (A) -- (B);
    \path[postaction={decorate}] (B) -- (C);
\end{tikzpicture}
\end{document}

enter image description here


You could just build your own and then have the full flexibility of controlling every aspect of its appearance.

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[|| mark/.style={postaction=decorate,decoration={markings,
mark=at position #1 with {\draw[line cap=round,mark segment] (-1pt,-2pt) -- (-1pt,2pt);
\draw[line cap=round,mark segment] (1pt,-2pt) -- (1pt,2pt);
}}},mark segment/.style={thick}]
    \coordinate (A) at (0,0);
    \coordinate (B) at (2,4);
    \coordinate (C) at (4,0);

    \draw(A)--(B)--(C)--cycle;
    \path[|| mark=0.5] (A) -- (B);
    \path[|| mark=0.5] (B) -- (C);
\end{tikzpicture}
\end{document}

enter image description here

enter image description here

A more customizable version thereof is

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{decorations.markings,angles}
\begin{document}
\tikzset{insert |/.style={decoration={markings,
  mark=at position #1 with {%
   \draw[line cap=round,mark segment] 
    (0,-\pgfkeysvalueof{/tikz/mark
    segment length}/2) -- (0,\pgfkeysvalueof{/tikz/mark
    segment length}/2);}
  }},
  | mark/.style={postaction=decorate,insert |=#1},
  insert ||/.style={decoration={markings,
  mark=at position #1 with {%
   \draw[line cap=round,mark segment] 
    (-\pgfkeysvalueof{/tikz/mark segment distance}/2,-\pgfkeysvalueof{/tikz/mark
    segment length}/2) -- (-\pgfkeysvalueof{/tikz/mark segment distance}/2,\pgfkeysvalueof{/tikz/mark
    segment length}/2);
   \draw[line cap=round,mark segment] (\pgfkeysvalueof{/tikz/mark segment distance}/2,-\pgfkeysvalueof{/tikz/mark
    segment length}/2) -- (\pgfkeysvalueof{/tikz/mark segment distance}/2,\pgfkeysvalueof{/tikz/mark
    segment length}/2);}
  }},
  || mark/.style={postaction=decorate,insert ||=#1},
 insert |||/.style={decoration={markings,
  mark=at position #1 with {%
   \draw[line cap=round,mark segment] 
    (-\pgfkeysvalueof{/tikz/mark segment distance},-\pgfkeysvalueof{/tikz/mark
    segment length}/2) -- (-\pgfkeysvalueof{/tikz/mark segment distance},\pgfkeysvalueof{/tikz/mark
    segment length}/2);
   \draw[line cap=round,mark segment] 
    (0,-\pgfkeysvalueof{/tikz/mark
    segment length}/2) -- (0,\pgfkeysvalueof{/tikz/mark
    segment length}/2); 
   \draw[line cap=round,mark segment] 
   (\pgfkeysvalueof{/tikz/mark segment distance},-\pgfkeysvalueof{/tikz/mark
    segment length}/2) -- (\pgfkeysvalueof{/tikz/mark segment distance},\pgfkeysvalueof{/tikz/mark
    segment length}/2);}
  }},
  ||| mark/.style={postaction=decorate,insert |||=#1},
 mark segment/.style={thick},
 mark segment options/.code=\tikzset{mark segment/.style={#1}},
 mark segment distance/.initial=2pt,
 mark segment length/.initial=4pt,
 angle deco |/.style={insert |=0.5,
      pic actions/.append code=\tikzset{postaction=decorate}},
 angle deco ||/.style={insert ||=0.5,
      pic actions/.append code=\tikzset{postaction=decorate}},
 angle deco |||/.style={insert |||=0.5,
      pic actions/.append code=\tikzset{postaction=decorate}}}
\begin{tikzpicture}[]
    \coordinate (A) at (0,0);
    \coordinate (B) at (2,4);
    \coordinate (C) at (4,0);

    \draw(A)--(B)--(C)--cycle;
    \path[| mark=0.5] (A) -- (B);
    \path[mark segment options={thick,yscale=2},|| mark=0.5] (B) -- (C);
    \path[mark segment options={blue,line width=1pt,scale=2},||| mark=0.5] (C) -- (A);
    \pic [draw,angle radius=1cm,angle deco ||] {angle = A--B--C};
\end{tikzpicture}
\end{document}

enter image description here

Explanation: With decoration.markings you switch to the tangent space at a given point, determined by the position. Thus a line in y direction will be orthogonal to the tangent at the curve at the point.

To be moved somewhere else A means to insert anything (like e.g. a diamond).

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{decorations.markings,angles,shapes.geometric,calc}
\begin{document}
\tikzset{insert any/.style={decoration={markings,
  mark=at position #1 with {%
   \path (0,0) node[any mark]{};}
  }},
  diamond mark/.style={postaction=decorate,any mark options=common diamond,insert any=#1},
  insert two/.style={decoration={markings,
  mark=at position #1 with {%
   \path (-\pgfkeysvalueof{/tikz/mark any distance}/2,0) node[any mark]{}
   (\pgfkeysvalueof{/tikz/mark any distance}/2,0) node[any mark]{};}
  }},
  two diamonds mark/.style={postaction=decorate,any mark options=common diamond,,insert two=#1},
 insert three/.style={decoration={markings,
  mark=at position #1 with {%
   \path (-\pgfkeysvalueof{/tikz/mark any distance},0) node[any mark]{}
   (0,0) node[any mark]{}
   (\pgfkeysvalueof{/tikz/mark any distance},0) node[any mark]{};}
  }},
  three diamonds mark/.style={postaction=decorate,any mark options=common diamond,insert three=#1},
 any mark/.style={transform shape},
 any mark options/.code=\tikzset{any mark/.append style={#1}},
  common diamond/.style={shape=diamond,inner  xsep=0.2ex,aspect=0.3,fill},
 mark any distance/.initial=0.6em,}
\begin{tikzpicture}[]
    \coordinate (A) at (0,0);
    \coordinate (B) at (2,4);
    \coordinate (C) at (4,0);

    \draw(A)--(B)--(C)--cycle;
    \path[diamond mark=0.5] (A) -- (B);
    \path[any mark options={aspect=0.5},two diamonds mark=0.5] (B) -- (C);
    \path[any mark options={blue,draw,fill=white},three diamonds mark=0.5] (C) -- (A);
\end{tikzpicture}
\end{document}

enter image description here