我正在尝试创建如下 tikz 图像:
\documentclass[border=1cm]{standalone}
\usepackage[dvipsnames]{xcolor}
\usepackage{newtxtext}
\usepackage{tikz}
\usetikzlibrary{decorations.text, fadings}
\tikzfading[name=fade out,
inner color=transparent!0,
outer color=transparent!5]
\begin{document}
\begin{tikzpicture}
% slant rectangle
\shade[shading=ball, ball color = gray!10, rounded corners=10, rotate=30] (3.0,2.8) rectangle (7.0,2.2);
%% small circles
\shade[shading=ball, ball color = gray!10] (1.5,3.75) circle (0.4cm);
\fill[Cyan] (1.5,3.75) circle (0.2cm);
%%% Big Rectangles
\shade[shading=ball, ball color = gray!10, rounded corners=10] (5.0,4.4) rectangle (11.6,7.6);
\fill[Cyan,rounded corners=10] (4.8,4.8) rectangle (11.3,7.3);
%% big circles
\shade[shading=ball, ball color = gray!10] (5.5,6) circle (1.6);
\fill [Cyan](5.5,6) circle (0.9cm);
\end{tikzpicture}
\end{document}
我想要的是
我想将其修改为. 草图部分已加阴影,以与手柄和圆形接头相呼应。
让你的解决方案成为像我这样的新 bea 可以理解的(我只需要修改),因为我将使用它作为另一张图片的一部分。
答案1
这样的东西适合你吗?如果不完全适合,你明白了,只需稍微改变一下尺寸。
\documentclass[border=1cm]{standalone}
\usepackage[dvipsnames]{xcolor}
\usepackage{newtxtext}
\usepackage{tikz}
\usetikzlibrary{decorations.text, fadings}
\tikzfading[name=fade out,
inner color=transparent!0,
outer color=transparent!5]
\begin{document}
\begin{tikzpicture}
% slant rectangle
\shade[shading=ball, ball color = gray!10,rotate=30] (3.2,2.8) -- ++ (2.5,0) to[bend right] ++ (0.65,0.4) --++ (-.05,-1.4) to[bend right] ++ (-0.65,0.4) -- ++ (-2.5,0) -- cycle;
%% small circles
\shade[shading=ball, ball color = gray!10] (1.5,3.75) circle (0.4cm);
\fill[Cyan] (1.5,3.75) circle (0.2cm);
%%% Big Rectangles
\shade[shading=ball, ball color = gray!10, rounded corners=10] (5.0,4.4) rectangle (11.6,7.6);
\fill[Cyan,rounded corners=10] (4.8,4.8) rectangle (11.3,7.3);
%% big circles
\shade[shading=ball, ball color = gray!10] (5.5,6) circle (1.6);
\fill [Cyan](5.5,6) circle (0.9cm);
\end{tikzpicture}
\end{document}