我正在尝试重现以下图片tikz
我可以画出看起来像那样的东西,但它并不相同...有机会画出它或使它变得更加漂亮吗?
我的代码是
\documentclass[demo]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{%
calc,%
fadings,%
shadings%
}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{shapes.geometric,calc}
\usetikzlibrary{backgrounds,fit}
\usetikzlibrary{shadows}
\usetikzlibrary{snakes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning}
\usepackage{graphicx}
\begin{document}
\begin{tikzpicture}
\draw[fill=black] (0,0) circle (1cm);
\draw[fill=black] (0,0.75) ellipse (1cm and 0.25cm);
\draw[fill=black] (0,-1) ellipse (0.6cm and 0.1cm);
\draw[fill=gray] (0,0.75) ellipse (0.8cm and 0.15cm);
\end{tikzpicture}
\end{document}
我的输出是
答案1
这是一个相当基本的变体:
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
[
black filler/.style={outer color=black, inner color=black!50, postaction={fill=black, fill opacity=.5}}
]
\path (-130:1.15 and .8) node [draw=black, rotate=-130, fill=black, rounded corners=2pt, isosceles triangle, minimum width=.25] {};
\path (-50:1.15 and .8) node [draw=black, rotate=-50, fill=black, rounded corners=2pt, isosceles triangle, minimum width=.25] {};
\draw [black filler] (0,0) circle (1.25 and .9);
\draw [inner color=black!25, outer color=black] (0,0.75) ellipse (1 and 0.25);
\path [inner color=gray, outer color=gray!75!black] (0,0.75) ellipse (0.85 and 0.175);
\end{tikzpicture}
\end{document}
编辑
这是一个pic
版本。pic
调用cauldron
并接受 3 个参数:第一个是大小,例如1
或10pt
或2cm
;第二个和第三个是坩埚内容的颜色。大小决定了相对的大锅的尺寸。
不确定你在做什么,但想想万圣节……
\PassOptionsToPackage{svgnames}{xcolor}
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{shapes.geometric,shadows}
\begin{document}
\tikzset{
cauldron filler/.style={draw=black, outer color=black, inner color=black!50, postaction={fill=black, fill opacity=.5}},
legs/.style={draw=black, fill=black, rounded corners=2pt, isosceles triangle, minimum width=.25},
cauldron glow/.style={circular glow={fill=#1}},
rim filler/.style={inner color=black!50, outer color=black},
liquid/.style={inner color=#1, outer color=#1!75!black},
pics/cauldron/.style n args=3{
code={
\path (-130:1.15*#1 and .8*#1) node [rotate=-130, legs] {};
\path (-50:1.15*#1 and .8*#1) node [rotate=-50, legs] {};
\path [cauldron filler] (0,0) circle (1.25*#1 and .9*#1);
\path [rim filler] (0,0.75*#1) ellipse (.975*#1 and 0.255*#1);
\path [cauldron glow=#2] (0,.75*#1) circle (.75*#1 and .18*#1);
\path [liquid=#3] (0,0.75*#1) ellipse (0.825*#1 and 0.1725*#1);
}
}
}
\begin{tikzpicture}
\path (0,0) pic {cauldron={1}{Silver}{gray}} ++(2.75,0) pic {cauldron={.75}{Silver}{Lime}} ++(2,0) pic {cauldron={.5}{Chartreuse}{ForestGreen}} (-2.75,0) pic {cauldron={.75}{Silver}{Crimson}} ++(-2,0) pic {cauldron={.5}{Red}{Maroon}};
\end{tikzpicture}
\end{document}
编辑2
下面是一个有边缘和“模糊”内容的:
\PassOptionsToPackage{rgb,x11names,svgnames,dvipsnames}{xcolor}
\documentclass[tikz,border=5pt,multi]{standalone}
\usetikzlibrary{shapes.geometric,shadows}
\begin{document}
\tikzset{
cauldron filler/.style={draw=black, outer color=black, inner color=black!50, postaction={fill=black, fill opacity=.5}},
legs/.style={draw=black, fill=black, rounded corners=2pt, isosceles triangle, minimum width=.25},
cauldron glow/.style={circular glow={fill=#1}},
rim drop/.style={rim filler, postaction={fill=#1!75!black, path fading=fuzzy ring 15 percent}},
rim filler/.style={inner color=black!50, outer color=black, draw=black},
fuzzy liquid/.style={inner color=#1, outer color=#1!75!black, path fading=circle with fuzzy edge 10 percent},
pics/rimmed cauldron/.style n args=3{
code={
\path (-130:1.15*#1 and .8*#1) node [rotate=-130, legs] {};
\path (-50:1.15*#1 and .8*#1) node [rotate=-50, legs] {};
\path [cauldron filler] (0,0) circle (1.25*#1 and .9*#1);
\path [rim drop=#2] (0,0.75*#1) ++(0,-.0125*#1) ellipse (.975*#1 and 0.275*#1);
\path [rim filler] (0,0.75*#1) ellipse (.975*#1 and 0.255*#1);
\path [cauldron glow=#2] (0,.75*#1) circle (.75*#1 and .18*#1);
\path [fuzzy liquid=#3] (0,0.75*#1) ellipse (0.825*#1 and 0.1725*#1);
}
}
}
\begin{tikzpicture}
\path pic {rimmed cauldron={1}{Silver}{Turquoise}};
\end{tikzpicture}
\end{document}
答案2
\documentclass[border=5]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\fill[rounded corners=1ex] (-1.25,0) -- (-1.6,-1.6) -- (0,-1) -- cycle;
\fill[rounded corners=1ex] (1.25,0) -- (1.6,-1.6) -- (0,-1) -- cycle;
\draw[inner color=black!80,outer color=black] (0,0) ellipse (2cm and 1.4cm);
\draw[fill=gray,line width=1.5mm] (0,1.1) ellipse (1.6cm and 0.25cm);
\end{tikzpicture}
\end{document}