
답변부터이 질문; 다음 코드를 사용하여 또 다른 십자가를 그렸습니다.
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{}
\begin{tikzpicture}[line join=round, line cap=round]
\def\edge{
(.5,.5) to [out=90,in=-90] ++ (0,1.05) to [out=0,in=-90] ++ (.52,.52) to [out=90,in=0] ++ (-.52,.52) to [out=90,in=0] ++ (-.52,.52) to [out=180,in=90] ++ (-.52,-.52) to [out=-180,in=90] ++ (-.52,-.52) to [out=-90,in=180] ++ (.52,-.52) to [out=-90,in=90] ++ (0,-1.05)}
\draw[line width=.1cm,blue, fill=blue!40!white, opacity=.6] (.5,.5) foreach \i in {0,90,180,270}{[rotate=\i] -- \edge} -- cycle;
\end{tikzpicture}
\end{frame}
\end{document}
나는 를 사용하면 [line join=round, line cap=round]
줄의 끝이 확장된다는 것을 알았습니다. 이 옵션을 생략하면 덜 매력적인 라인 조인이 생성됩니다.
line join=round
확장된 부분을 생성하지 않고 선의 둥근 끝을 생성하는 데 어떻게 사용할 수 있습니까?
답변1
이는 코드의 단순한 계산 오류입니다. 실제로 경로는 해당 지점에서 시작 (.5,.5)
하지만 반원의 반경은.52
.끝나지 않아좌표점에서 십자가의 1/4 지점 (-.5,.5)
. .52
의 반경을 으로 바꾸면 .5
문제가 해결됩니다. 불필요한 작업을 제거하여 코드를 약간 단순화했습니다 to
.
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{}
\begin{tikzpicture}[line join=round, line cap=round]
\def\edge{
(.5,.5) -- ++ (0,1.05) to [out=0,in=-90] ++ (.5,.5) to [out=90,in=0] ++ (-.5,.5) to [out=90,in=0] ++ (-.5,.5) to [out=180,in=90] ++ (-.5,-.5) to [out=-180,in=90] ++ (-.5,-.5) to [out=-90,in=180] ++ (.5,-.5) -- ++ (0,-1.05)}
\draw[line width=.1cm,blue, fill=blue!40!white, opacity=.6] (.5,.5) foreach \i in {0,90,180,270}{[rotate=\i] -- \edge}--cycle;
\end{tikzpicture}
\end{frame}
\end{document}
답변2
귀하의 코드는 \edge
단축될 수 있습니다매우이렇게 단축하면 문제도 자동으로 해결됩니다. 또한 transparency group
경계에 두 가지 색상이 있는 것을 방지하기 위해 a를 사용하고 싶을 수도 있습니다 .
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{}
\begin{tikzpicture}[line join=round, line cap=round]
\def\edge{
(.5,.5) -- ++ (0,1.05)foreach \j in {0,90,180} {to [out=\j,in=\j,looseness=1.6] ++ (\j+90:1)}}
\begin{scope}[transparency group,opacity=.6]
\draw[line width=.1cm,blue, fill=blue!40!white] (.5,.5) foreach \i in {0,90,180,270}{[rotate=\i] -- \edge} -- cycle;
\end{scope}
\end{tikzpicture}
\end{frame}
\end{document}
답변3
수제 교대 근무는 사악합니다! 노드 라벨링을 사용하는 가장 적합한 솔루션(유지 관리 용이성)이 있어야 한다고 확신하지만 tikz
그러한 솔루션을 그릴 만큼 익숙하지 않습니다. 그동안 다음을 시도해 볼 수 있습니다.
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{}
\begin{tikzpicture}[line join=round, line cap=round]
\def\edge{
(.5,.5) to [out=90,in=-90] ++ (0,1.05) to [out=0,in=-90] ++ (.5,.5) to [out=90,in=0] ++ (-.5,.5) to [out=90,in=0] ++ (-.5,.5) to [out=180,in=90] ++ (-.5,-.5) to [out=-180,in=90] ++ (-.5,-.5) to [out=-90,in=180] ++ (.5,-.5) to [out=-90,in=90] ++ (0,-1.05)}
\draw[line width=.1cm,blue, fill=blue!40!white, opacity=.6] (.5,.5) foreach \i in {0,90,180,270}{[rotate=\i] -- \edge} -- cycle;
\end{tikzpicture}
\end{frame}
\end{document}