4

Does a solution already exist for this feature request? I want to draw 90°-corners with two 45°-bends w/o doing it manually (quite tedious). I am looking for something similar to rounded corners like "bended corners".

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[bended corners=0.1cm] (0,0) rectangle (5,5);
\end{tikzpicture}
\end{document}

The result should like the one of this code:

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
%\draw[bended corners=0.1cm] (0,0) rectangle (5,5);
 \draw (0,0) -- (0.9,0) -- (1,0.1) -- (1,1);
\end{tikzpicture}
\end{document}
2
7

May be I don't understand the question but what's the difference between OP's bended corners and already defined rounded corners?

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[help lines] (0,0) grid[step=.5cm] (5,5);
\draw[thick, blue, rounded corners=1cm] (0,0) rectangle (5,5);
\draw[red, opacity=.5, ultra thick] (4,5) arc(90:45:1); 
\draw[green, opacity=.5, ultra thick] (5,4) arc(0:45:1); 
\end{tikzpicture}
\end{document}

enter image description here

Update: After second code, I think OP wants a chamfered rectangle

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.misc}

\begin{document}
\begin{tikzpicture}
%\draw[bended corners=0.1cm] (0,0) rectangle (5,5);
\node[draw, minimum size=3cm, chamfered rectangle] {};
\end{tikzpicture}
\end{document}

enter image description here

3
  • I added a second code to my question.
    – Jürgen
    Mar 12 at 8:40
  • @Rmano Yes. I've updated the answer with an example.
    – Ignasi
    Mar 12 at 8:51
  • That's really fine, thanks a lot. What do I have to do if I don't want a whole rectangle but only an open path (see second code in OP)?
    – Jürgen
    Mar 12 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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