修正计算错误,以产生更具吸引力的圆角线尾连接

修正计算错误,以产生更具吸引力的圆角线尾连接

从答案到问题,我使用以下代码绘制了一个十字,产生了一个延伸的圆角。我知道这是由于计算错误造成的,但我不知道该调整哪些措施。

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty % suppress navigation bar
\usepackage{verbatim}
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{Coptic Cross original final (question applied)}
\begin{tikzpicture}[line join=round, line cap=round]
\def\edge{
(.5,.5) to [out=90,in=-160] ++ (1,1.45) to [out=130,in=0] ++ (-1,.35) to [out=90,in=-20] ++ (-.5,.8) to [out=-160,in=90] ++ (-.5,-.8) to [out=180,in=50] ++ (-1,-.35) to [out=-20,in=90] ++ (1,-1.45)}
\draw[line width=.1cm,blue, fill=blue!40!white, opacity=.6, rounded corners=.1cm] (.5,.5) foreach \i in {0,90,180,270}{[rotate=\i] -- \edge} -- cycle;
\end{tikzpicture}
\end{frame}
\end{document}

在此处输入图片描述

答案1

问题不在于计算错误,而在于您使用圆角和长度为 0 的路径。只需摆脱这些路径即可。

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty % suppress navigation bar
\usepackage{verbatim}
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{Coptic Cross original final (question applied)}
\begin{tikzpicture}[line join=round, line cap=round]
\def\edge{
(.5,.6) to [out=90,in=-160] ++ (1,1.45) to [out=130,in=0] ++ (-1,.35) to
[out=90,in=-20] ++ (-.5,.8) to [out=-160,in=90] ++ (-.5,-.8) to [out=180,in=50]
++ (-1,-.35) to [out=-20,in=90] ++ (1,-1.45)}
\draw[line width=.1cm,blue, fill=blue!40!white, opacity=.6, rounded
corners=.1cm] (.5,.6) foreach \i in {0,90,180,270}{[rotate=\i] -- \edge} --
cycle;
\end{tikzpicture}
\end{frame}
\end{document}

在此处输入图片描述

另一种方法是根据需要关闭或打开圆角。

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty % suppress navigation bar
\usepackage{verbatim}
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{Coptic Cross original final (question applied)}
\begin{tikzpicture}[line join=round, line cap=round]
\def\edge{
(0,3.1) to [out=-160,in=90] ++ (-.5,-.8) 
[rounded corners=2pt]
 to [out=180,in=50] ++ (-1,-.35) 
 to [out=-20,in=90] ++ (1,-1.45)
 to [out=180,in=-70] ++ (-1.45,1) 
 to [out=220,in=90] ++ (-.35,-1) [sharp corners]
 to [out=180,in=70] ++ (-.8,-.5)
}
\draw[line width=.1cm,blue, fill=blue!40!white, opacity=.6] 
(0,3.1) foreach \i in {0,90,180,270}{[rotate=\i] -- \edge} --
cycle;
\end{tikzpicture}
\end{frame}
\end{document}

在此处输入图片描述

相关内容