TransWikia.com

Rounded Corners of a Double Line

TeX - LaTeX Asked by berkus on July 16, 2021

Is there a way to round the corners of the inner line of a double line?

documentclass[]{standalone}    
usepackage{tikz}

begin{document}
    begin{tikzpicture}

        draw [line width = 2pt, double distance = 6pt,
              rounded corners=3pt, line cap=round] (0,0) -- (3,4) -- (5,0);

    end{tikzpicture}       
end{document}

enter image description here

One Answer

I don't know exactly how tikz computes the radii of the rounded corners here, but I guess that the radius you provide, 3pt would be the radius of a single line (my blue line). So the outer line radius need to be 3+3pt=6pt due to the separation and the inner line radius will be 3-3=0pt. If you change your radius for a bigger one the rounder corners are really rounded.

documentclass[border=2mm]{standalone}    
usepackage{tikz}
usetikzlibrary{calc}

begin{document}
begin{tikzpicture}
  foreach[count=xi]i in {6,10,...,22}
  {%
    begin{scope}[shift={(5.5*xi,0)}]
      draw [line width = 2pt, double distance = 6pt,
             rounded corners=i pt, line cap=round] (0,0) -- (3,4) -- (5,0);
      draw [line width = 2pt, blue,
             rounded corners=i pt, line cap=round] (0,0) -- (3,4) -- (5,0);
    end{scope}
  }
end{tikzpicture} 

enter image description here

Correct answer by Juan Castaño on July 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP