我怎么能像这样在中间添加一个东西呢
这里
\documentclass[margin=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[font=\tiny\sffamily, thin]
% Roulette Wheel
\pgfmathtruncatemacro\s{36}
\pgfmathsetmacro\R{1.7}% Outer Radius Number
\pgfmathsetmacro\r{1.4}% Inner Radius Number
\pgfmathsetmacro\Radius{0.5*(\R+\r)}% Fill-Radius Number
\pgfmathsetlengthmacro\LW{1cm*(\R-\r)}% Line Width of Fill
\pgfmathsetmacro\rT{1.0}% Inner Radius Wheel
\pgfmathsetmacro\rA{2.3}% Outer Radius Wheel
\pgfmathsetmacro\rD{0.5*(\rA+\R)-0.025}% Radius of Diamonds
\pgfmathsetmacro\wM{360/(\s+1)}% Middle Point Angle
% List of Numbers
\def\RLT{0, 32, 15, 19, 4, 21, 2, 25, 17, 34, 6, 27, 13, 36, 11, 30, 8, 23, 10, 5, 24, 16, 33, 1, 20, 14, 31, 9, 22, 18, 29, 7, 28, 12, 35, 3, 26}
% Array of List
\def\RLTa{{\RLT}}
\foreach \Place in {0,...,\s}{%%
\pgfmathsetmacro\wStart{90-0.5*\wM-\Place*\wM}% Startangle
\pgfmathsetmacro\wEnd{\wStart+\wM}% Endangle
\pgfmathsetmacro\wMiddle{\wStart+0.5*\wM)}%
% Fill Number Areas
\pgfmathsetmacro\rscolor{mod(\Place,2)==0 ? 1 : 0}
\ifnum\Place=0 \colorlet{rscolor}{green!66!black} \else%
\ifnum\rscolor=1 \colorlet{rscolor}{black} \else \colorlet{rscolor}{red}%
\fi\fi%
\path[draw=rscolor, line width=\LW,
] ([shift=(\wStart:\Radius)]0,0) arc[start angle=\wStart, end angle=\wEnd, radius=\Radius];
% Write Numbers
\path[draw=none] (\wMiddle:\r) -- (\wMiddle:\R) node[inner sep=0pt, midway,
rotate={-\Place*\wM}, text=white,
]{\pgfmathprint{\RLTa[\Place]}};
% Poches
\draw[] (\wStart:\rT) -- (\wStart:\R);
}%%
% Circles
\draw[] circle[radius=\R];
\draw[] circle[radius=\r];
\draw[] circle[radius=\rT];
\draw[double,double distance=0.4pt] circle[radius=\rA];
% Diamonds
\foreach \w in {60, 120,...,360}{%%
\node[shape=diamond, draw, inner sep=0pt,
minimum width=1mm, minimum height=2.5mm, very thin, rotate=\w,
] at (\w:\rD){};
}%%
\foreach \w in {30, 90,...,330}{%%
\node[shape=diamond, draw, inner sep=0pt,
minimum width=2mm, minimum height=1mm, very thin, rotate=\w,
] at (\w:\rD){};
}%%
\end{tikzpicture}
\end{document}
答案1
我擅自简化了您的代码,添加了一些样式和一个\pic
插槽。
我也画了一个更简单的手臂版本,希望对你有帮助。每个手臂都有一个梯形和一个圆形,用一个\foreach
环重复并旋转,顶部还有几个圆形。它们有一个旋转参数,你可以根据需要更改。
代码:
\documentclass[tikz,margin=5mm]{standalone}
\usetikzlibrary{shapes.geometric}
\tikzset
{% slots styles
fill0/.style={fill=green!66!black},
fill1/.style={fill=black},
fill2/.style={fill=red},
% diamond style
my diamond/.style={shape=diamond,draw,inner sep=0pt,minimum width=1mm,minimum height=2.5mm,very thin},
% slot
pics/slot/.style n args={3}{code=
{% #1 = inner radius, #2 = outer radius, #3 = node
\draw[pic actions] (-0.5*\slotangle:#1) arc (-0.5*\slotangle:0.5*\slotangle:#1) --
(0.5*\slotangle:#2) arc (0.5*\slotangle:-0.5*\slotangle:#2) -- cycle;
\node[transform shape,white,rotate=-90] (-n) at (0:0.5*#1+0.5*#2) {#3};
}},
}
\begin{document}
\begin{tikzpicture}[font=\tiny\sffamily]
% Roulette Wheel
\pgfmathsetmacro\slotangle{360/37}
\pgfmathsetmacro\R {1.7} % Outer Radius Number
\pgfmathsetmacro\r {1.4} % Inner Radius Number
\pgfmathsetmacro\rT{1.0} % Inner Radius Wheel
\pgfmathsetmacro\rA{2.3} % Outer Radius Wheel
\pgfmathsetmacro\rD{0.5*(\rA+\R)-0.025} % Radius of Diamonds
% Circle
\draw[double,double distance=0.4pt] circle[radius=\rA];
% Diamonds
\foreach \w in {30,60,...,360}
\node[my diamond,rotate={\w-3*mod(\w,60)}] at (\w:\rD) {};
% Slots
\foreach[count=\ii from 0]\i in {0,32,15,19,4,21,2,25,17,34,6,27,13,
36,11,30,8,23,10,5,24,16,33,1,20,14,
31,9,22,18,29,7,28,12,35,3,26}
{
\pgfmathsetmacro\stn{\ii==0 ? 0 : int(mod(\ii,2)+1)} % slot style
\pic[rotate=90-\slotangle*\ii,fill\stn] {slot={\r}{\R}{\i}};
\pic[rotate=90-\slotangle*\ii] (\i) {slot={\rT}{\r}{}};
}
% Arms
\pgfmathsetmacro\rt{30} % rotation
\foreach\i in {0,90,180,270}
{
\draw[rotate=\i+\rt,fill=gray] (0,0.1) -- (0.7,0.05) -- (0.7,-0.05) -- (0,-0.1) -- cycle;
\draw[fill=gray!30!black] (\i+\rt:0.7) circle (0.1);
}
\draw[fill=gray!50!black] (0,0) circle(0.2);
\draw[fill=gray] (0,0) circle(0.1);
% Ball
\draw[shading=ball,ball color=yellow,very thin] (23-n) circle (0.05);
\end{tikzpicture}
\end{document}
答案2
它的结构不是很好,但看起来更像照片:
\documentclass[margin=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[font=\tiny\sffamily, thin]
% Roulette Wheel
\pgfmathtruncatemacro\s{36}
\pgfmathsetmacro\R{1.7}% Outer Radius Number
\pgfmathsetmacro\r{1.4}% Inner Radius Number
\pgfmathsetmacro\Radius{0.5*(\R+\r)}% Fill-Radius Number
\pgfmathsetlengthmacro\LW{1cm*(\R-\r)}% Line Width of Fill
\pgfmathsetmacro\rT{1.0}% Inner Radius Wheel
\pgfmathsetmacro\rA{2.3}% Outer Radius Wheel
\pgfmathsetmacro\rD{0.5*(\rA+\R)-0.025}% Radius of Diamonds
\pgfmathsetmacro\wM{360/(\s+1)}% Middle Point Angle
% List of Numbers
\def\RLT{0, 32, 15, 19, 4, 21, 2, 25, 17, 34, 6, 27, 13, 36, 11, 30, 8, 23, 10, 5, 24, 16, 33, 1, 20, 14, 31, 9, 22, 18, 29, 7, 28, 12, 35, 3, 26}
% Array of List
\def\RLTa{{\RLT}}
\foreach \Place in {0,...,\s}{%%
\pgfmathsetmacro\wStart{90-0.5*\wM-\Place*\wM}% Startangle
\pgfmathsetmacro\wEnd{\wStart+\wM}% Endangle
\pgfmathsetmacro\wMiddle{\wStart+0.5*\wM)}%
% Fill Number Areas
\pgfmathsetmacro\rscolor{mod(\Place,2)==0 ? 1 : 0}
\ifnum\Place=0 \colorlet{rscolor}{green!66!black} \else%
\ifnum\rscolor=1 \colorlet{rscolor}{black} \else \colorlet{rscolor}{red}%
\fi\fi%
\path[draw=rscolor, line width=\LW,
] ([shift=(\wStart:\Radius)]0,0) arc[start angle=\wStart, end angle=\wEnd, radius=\Radius];
% Write Numbers
\path[draw=none] (\wMiddle:\r) -- (\wMiddle:\R) node[inner sep=0pt, midway,
rotate={-\Place*\wM}, text=white,
]{\pgfmathprint{\RLTa[\Place]}};
% Poches
\draw[] (\wStart:\rT) -- (\wStart:\R);
}%%
% Circles
\draw[] circle[radius=\R];
\draw[] circle[radius=\r];
\draw[] circle[radius=\rT];
\draw[double,double distance=0.4pt] circle[radius=\rA];
% Diamonds
\foreach \w in {60, 120,...,360}{%%
\node[shape=diamond, draw, inner sep=0pt,
minimum width=1mm, minimum height=2.5mm, very thin, rotate=\w,
] at (\w:\rD){};
}%%
\foreach \w in {30, 90,...,330}{%%
\node[shape=diamond, draw, inner sep=0pt,
minimum width=2mm, minimum height=1mm, very thin, rotate=\w,
] at (\w:\rD){};
}%%
% Rotating Arms
\foreach \w in {-45, 45, 135, -135}{%%
\begin{scope}[rotate=\w]
\draw[fill=white, rounded corners=0.25mm] (-0.05, 0.2)
-- (-0.05, 0.4)
-- ++(135:0.05)
-- ++(45:0.05)
-- ++(100:0.15)
-- ++(80:0.15)
-- ++(135:0.05)
-- ++(45:0.05) % ------------
-- ++(0.1,0)
-- ++(-45:0.05)
-- ++(135+90:0.05)
-- ++(-80:0.15)
-- ++(-100:0.15)
-- ++(-45:0.05)
-- ++(135+90:0.05)
-- ++(0, -0.2) -- cycle;
\pgfmathsetmacro\wStart{-135}% Startangle
\pgfmathsetmacro\wEnd{\wStart-360+90}% Endangle
\pgfmathsetmacro\Radius{0.075}% Fill-Radius Number
\path[, draw,fill=white,
] ([shift=(\wStart:\Radius)]0,0.875) arc[start angle=\wStart, end angle=\wEnd, radius=\Radius];
\end{scope}
}%%
\begin{scope}[]
\draw[fill=white] circle[radius=0.225];
\draw[] circle[radius=0.125];
\draw[] circle[radius=0.075];
%\draw[] circle[radius=0.05];% only arc
\pgfmathsetmacro\wStart{220}% Startangle
\pgfmathsetmacro\wEnd{\wStart-170}% Endangle
\pgfmathsetmacro\Radius{0.05}% Fill-Radius Number
\path[draw,
] ([shift=(\wStart:\Radius)]0,0) arc[start angle=\wStart, end angle=\wEnd, radius=\Radius];
\end{scope}
\end{tikzpicture}
\end{document}