下面的图片产生了难看的尖锐边缘
\documentclass[11pt]{scrartcl}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}
\draw[fill=black]
(-2,1) circle (2pt) node (tl) {}
(0,1) circle (2pt) node (tc) {}
(2,1) circle (2pt) node (tr) {}
(-6,0) circle (2pt) node (ll) {}
(-4,0) circle (2pt) node (l) {}
(4,0) circle (2pt) node (r) {}
(6,0) circle (2pt) node (rr) {};
\draw[draw=orange, fill=orange]
(-2,-1) circle (2pt) node (bl) {}
(0,-1) circle (2pt) node (bc) {}
(2,-1) circle (2pt) node (br) {};
\draw[>=latex, ->, thick]
(l) edge (tl)
(r) edge (tr);
\draw[>=latex, ->,thin, orange]
(bl) edge (l)
(br) edge (r);
\draw[>=latex, <->, thick]
(ll) edge (l)
(rr) edge (r)
(tl) edge (tc)
(tc) edge (tr);
\draw[>=latex, <->, orange]
(bl) edge (bc)
(bc) edge (br);
\path[rounded corners=1cm, draw=gray!70]
(-1-6,1) -- (2-6,1) -- (4-6,2) -- (8-6,2) --
(10-6,1) -- (13-6,1) --(13-6,-1) -- (10-6,-1) --
(8-6,0) -- (4-6,0) -- (2-6,-1) -- (-1-6,-1) -- cycle;
\path[rounded corners=1.5cm, draw=gray!50]
(-1-6-0.5,1+0.5) -- (2-6,1+0.5) -- (4-6,2+0.5) --
(8-6,2+0.5) -- (10-6,1+0.5) -- (13-6+0.5,1+0.5) --
(13-6+0.5,-1-0.5) -- (10-6,-1-0.5) -- (8-6,-2-0.5) --
(4-6,-2-0.5) -- (2-6,-1-0.5) -- (-1-6-0.5,-1-0.5) -- cycle;
\end{tikzpicture}
\end{center}
\end{document}
显然,圆角首先计算圆角,然后用直线段连接端点。如果我设置rounded corners=1cm
第二条曲线,问题就消失了。
如何才能使食品储藏室的边角变得圆润而没有锯齿状的边缘?
答案1
如果放大到一定程度,1cm 也太大了,而且看不清。但对于有限数量的操作(主要是路径变形操作),您可以通过将内容放在括号内并为其提供选项来临时更改设置。
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\path[rounded corners=1.5cm, draw=gray!50]
(-1-6-0.5,1+0.5) -- (2-6,1+0.5) {[rounded corners=0.5cm]-- (4-6,2+0.5)} --
(8-6,2+0.5) {[rounded corners=0.1cm]-- (10-6,1+0.5)} -- (13-6+0.5,1+0.5) --
(13-6+0.5,-1-0.5) -- (10-6,-1-0.5) {[rounded corners=0.8cm]--(8-6,-2-0.5)} --
(4-6,-2-0.5) {[rounded corners=0.8cm]--(2-6,-1-0.5)} --(-1-6-0.5,-1-0.5)-- cycle;
\end{tikzpicture}
\end{document}