
答案1
發生這種情況是因為您在不應該存在的地方添加了圓角(由於數值最小錯誤,我收回了圓角,感謝 Kpym!),以下是避免這種情況的方法。
\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw[rounded corners]
(0,0) -| ++ (-.5,.5) -- ++ (-2,0) -- ++ (0,-4) -- ++ (8,0)
|- (1,0) -- cycle ;
\end{tikzpicture}
\end{document}
附錄:正如 Kpym 指出的那樣,眾所周知,此類問題有時會出現。在其他情況下糾正問題的另一種方法是關閉圓角。我在這裡無法以有用的方式應用它,因為上面的方法更簡單,但我可以證明這是可行的。
\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw[rounded corners]
(0,0) -| ++ (-.5,.5) -- ++ (-2,0) -- ++ (0,-4) [rounded corners=false]
-- ++ (8,0) |- (1,0) -- cycle ;
\end{tikzpicture}
\end{document}
我知道這不是您所追求的,但我發現在其他情況下能夠暫時關閉圓角很有用。在這方面,與您無法沿路徑以這種方式更改rounded corners
的鍵不同。color