
ab 세그먼트 없이 다음 그림을 그리는 더 좋은 방법이 있습니까? 나는 다음 코드를 사용했다
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[scale=5.5]
\node[regular polygon, regular polygon sides=6, minimum size=10cm, rounded corners, draw] at (0,0) {};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Erase ab segment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\draw[ultra thick, white](-.377,.787025) -- (.377,.787025);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\draw(.377,.787025)arc(276:90:.06);
\draw(-.377,.787025)arc(-96:90:.06);
\def\mypath{(-.06,-.98) -- (-.06,-.95) arc (180:0:.06cm) -- (.06,-.98)}
\foreach \t in {0,120,240} {\draw [rotate=\t] \mypath;}
\def\mypath{(0,.98) -- (0,.98) arc (90:55.5:.98cm)}% -- (0,0)}
\draw [rotate=56.5] \mypath;
\def\mypath{(0,.98) -- (0,.98) arc (90:55.5:.98cm)}% -- (0,0)}
\draw [rotate=-22] \mypath;
\def\mypath{(0,.98) -- (0,.98) arc (90:-23:.98cm)}% -- (0,0)}
\draw [rotate=176.5] \mypath;
\def\mypath{(0,.98) -- (0,.98) arc (90:-23:.98cm)}% -- (0,0)}
\draw [rotate=296.5] \mypath;
\end{tikzpicture}
\end{document}
답변1
노드를 적절한 경로로 바꾸십시오. 육각형 외접원의 지름은 크기 조정되지 않은 10cm라는 것을 알고 있습니다(옵션을 사용할 때 노드의 크기가 조정되지 않기 때문입니다 scale
). 따라서 육각형 외접원의 축척된 반지름은 5cm / 5.5입니다.
또한 상단에 있는 두 개의 반원이 시작하고 끝나는 좌표도 알고 있습니다. 따라서 \draw
극좌표를 사용하여 노드 모양의 윤곽을 쉽게 다시 만들 수 있습니다 .
다음 코드 예제에서는 코드를 약간 단순화하고 현재 구문으로 업데이트했습니다.
\documentclass[tikz,border=5]{standalone}
%\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[scale=5.5]
% \node[regular polygon, regular polygon sides=6, minimum size=10cm, rounded corners, draw] at (0,0) {};
\draw[rounded corners] (-.377,.787025) -- (120:{5/5.5}) -- (180:{5/5.5}) -- (240:{5/5.5}) -- (300:{5/5.5}) -- (360:{5/5.5}) -- (60:{5/5.5}) -- (.377,.787025);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Erase ab segment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \draw[ultra thick, white](-.377,.787025) -- (.377,.787025);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\draw(.377,.787025) arc[start angle=276, end angle=90, radius=.06];
\draw(-.377,.787025) arc[start angle=-96, end angle=90, radius=.06];
\def\mypath{(-.06,-.98) -- (-.06,-.95) %
arc[start angle=180, end angle=0, radius=.06] -- (.06,-.98)}
\foreach \t in {0,120,240} {
\draw[rotate=\t] \mypath;
}
\def\mypath{(0,.98) -- (0,.98) arc[start angle=90, end angle=55.5, radius=.98]}
\draw[rotate=56.5] \mypath;
\draw[rotate=-22] \mypath;
\def\mypath{(0,.98) -- (0,.98) arc[start angle=90, end angle=-23, radius=.98cm]}
\draw[rotate=176.5] \mypath;
\draw[rotate=296.5] \mypath;
\end{tikzpicture}
\end{document}