Tikz 中的太阳耀斑效果

Tikz 中的太阳耀斑效果

我知道如何使用 Tikz(使用 Mathcha.io 编辑器)在几周内重新创建下面从 Wikipedia 截取的图形。但是......我找不到重现太阳耀斑效果的技巧。有人知道如何做到这一点或使用纯 tikz 的解决方法吗?

感谢您的帮助(反馈)

在此处输入图片描述

以下是我目前使用 Mathcha.io 所做的事情(太阳内部不会有问题,但我还没有找到让太阳耀斑逼真的好技巧)。

% Gradient Info
  
\tikzset {_t5fm1pwc6/.code = {\pgfsetadditionalshadetransform{ \pgftransformshift{\pgfpoint{0 bp } { 0 bp }  }  \pgftransformscale{1 }  }}}
\pgfdeclareradialshading{_obsq0geoy}{\pgfpoint{0bp}{0bp}}{rgb(0bp)=(0.97,0.67,0.27);
rgb(0.08117079734802246bp)=(0.97,0.67,0.27);
rgb(25bp)=(1,1,1);
rgb(400bp)=(1,1,1)}

% Gradient Info
  
\tikzset {_iuwzyyncp/.code = {\pgfsetadditionalshadetransform{ \pgftransformshift{\pgfpoint{0 bp } { 0 bp }  }  \pgftransformscale{1 }  }}}
\pgfdeclareradialshading{_kh4b0jmmf}{\pgfpoint{0bp}{0bp}}{rgb(0bp)=(0.97,0.67,0.27);
rgb(18.609733070646016bp)=(0.97,0.67,0.27);
rgb(25bp)=(1,1,1);
rgb(400bp)=(1,1,1)}
\tikzset{_pmbtb93xf/.code = {\pgfsetadditionalshadetransform{\pgftransformshift{\pgfpoint{0 bp } { 0 bp }  }  \pgftransformscale{1 } }}}
\pgfdeclareradialshading{_astx8j2w0} { \pgfpoint{0bp} {0bp}} {color(0bp)=(transparent!0);
color(18.609733070646016bp)=(transparent!0);
color(25bp)=(transparent!60);
color(400bp)=(transparent!60)} 
\pgfdeclarefading{_dtm1q1pyh}{\tikz \fill[shading=_astx8j2w0,_pmbtb93xf] (0,0) rectangle (50bp,50bp); } 
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt        

\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: \path (0,563); %set diagram left start at 0, and has height of 563

%Shape: Star [id:dp023212525835953457] 
\draw  [draw opacity=0][shading=_obsq0geoy,_t5fm1pwc6] (312.74,-9.01) -- (324.39,116.79) -- (359.15,-4.48) -- (347.28,121.29) -- (403.88,8.93) -- (368.92,130.14) -- (445.31,30.75) -- (388.53,143.01) -- (481.96,60.18) -- (405.4,159.44) -- (512.49,96.17) -- (418.92,178.83) -- (535.8,137.4) -- (428.61,200.49) -- (551.05,182.4) -- (434.1,223.62) -- (557.68,229.53) -- (435.21,247.4) -- (555.46,277.09) -- (431.89,270.97) -- (544.47,323.36) -- (424.27,293.46) -- (525.1,366.67) -- (412.61,314.08) -- (498.06,405.45) -- (397.35,332.07) -- (464.32,438.31) -- (379.03,346.79) -- (425.11,464.05) -- (358.31,357.7) -- (381.83,481.75) -- (335.94,364.4) -- (336.05,490.76) -- (312.74,366.67) -- (289.43,490.76) -- (289.54,364.4) -- (243.65,481.75) -- (267.17,357.7) -- (200.37,464.05) -- (246.45,346.79) -- (161.16,438.31) -- (228.13,332.07) -- (127.42,405.45) -- (212.87,314.08) -- (100.37,366.67) -- (201.21,293.46) -- (81.01,323.36) -- (193.59,270.97) -- (70.02,277.09) -- (190.27,247.4) -- (67.8,229.53) -- (191.38,223.62) -- (74.43,182.4) -- (196.87,200.49) -- (89.68,137.4) -- (206.56,178.83) -- (112.99,96.17) -- (220.08,159.44) -- (143.52,60.18) -- (236.95,143.01) -- (180.16,30.75) -- (256.56,130.14) -- (221.6,8.93) -- (278.2,121.29) -- (266.33,-4.48) -- (301.08,116.79) -- cycle ;
%Shape: Circle [id:dp6728583001635919] 
\draw  [draw opacity=0][shading=_kh4b0jmmf,_iuwzyyncp,path fading= _dtm1q1pyh ,fading transform={xshift=2}] (164.36,228.64) .. controls (164.36,148.01) and (229.73,82.64) .. (310.36,82.64) .. controls (390.99,82.64) and (456.36,148.01) .. (456.36,228.64) .. controls (456.36,309.27) and (390.99,374.64) .. (310.36,374.64) .. controls (229.73,374.64) and (164.36,309.27) .. (164.36,228.64) -- cycle ;
%Shape: Circle [id:dp9879493462214302] 
\draw  [draw opacity=0][fill={rgb, 255:red, 248; green, 171; blue, 70 }  ,fill opacity=1 ] (180.72,228.64) .. controls (180.72,157.04) and (238.76,99) .. (310.36,99) .. controls (381.96,99) and (440,157.04) .. (440,228.64) .. controls (440,300.24) and (381.96,358.28) .. (310.36,358.28) .. controls (238.76,358.28) and (180.72,300.24) .. (180.72,228.64) -- cycle ;
%Shape: Pie [id:dp27943444307429344] 
\draw  [draw opacity=0][fill={rgb, 255:red, 182; green, 77; blue, 32 }  ,fill opacity=1 ] (270.29,118.5) .. controls (283.24,113.19) and (297.27,110.3) .. (311.91,110.3) .. controls (367.35,110.3) and (413.93,151.84) .. (427.15,208.06) -- (311.91,240.7) -- cycle ;
%Shape: Pie [id:dp26161119443463554] 
\draw  [draw opacity=0][fill={rgb, 255:red, 152; green, 80; blue, 45 }  ,fill opacity=1 ] (203.15,271.05) .. controls (201.19,261.3) and (200.15,251.13) .. (200.15,240.67) .. controls (200.15,185.08) and (229.57,137.55) .. (271.13,118.4) -- (311.95,240.67) -- cycle ;
%Shape: Chord [id:dp35742807417325095] 
\draw  [draw opacity=0][fill={rgb, 255:red, 140; green, 48; blue, 12 }  ,fill opacity=1 ] (427.15,208.06) .. controls (427.28,208.37) and (427.38,208.67) .. (427.47,208.99) .. controls (432.17,225.59) and (385.83,253.25) .. (323.96,270.76) .. controls (262.09,288.26) and (208.12,288.99) .. (203.42,272.39) .. controls (203.3,271.95) and (203.21,271.5) .. (203.15,271.05) -- cycle ;
%Shape: Pie [id:dp7799037211043129] 
\draw  [draw opacity=0][fill={rgb, 255:red, 250; green, 189; blue, 54 }  ,fill opacity=1 ] (281.07,142.83) .. controls (290.74,139.17) and (301.11,137.19) .. (311.91,137.19) .. controls (355.92,137.19) and (392.89,170.16) .. (403.39,214.79) -- (311.91,240.7) -- cycle ;
%Shape: Pie [id:dp34879155552294594] 
\draw  [draw opacity=0][fill={rgb, 255:red, 238; green, 246; blue, 123 }  ,fill opacity=1 ] (296.83,196.41) .. controls (301.52,194.49) and (306.6,193.44) .. (311.91,193.44) .. controls (331.5,193.44) and (348.04,207.75) .. (353.29,227.35) -- (311.91,240.7) -- cycle ;
%Shape: Pie [id:dp012569297105571309] 
\draw  [draw opacity=0][fill={rgb, 255:red, 235; green, 132; blue, 35 }  ,fill opacity=1 ] (209.23,269.18) .. controls (207.61,259.99) and (206.76,250.43) .. (206.76,240.63) .. controls (206.76,185.99) and (233.25,139.13) .. (270.97,119.22) -- (311.5,240.63) -- cycle ;
%Shape: Pie [id:dp27427186754084887] 
\draw  [draw opacity=0][fill={rgb, 255:red, 141; green, 47; blue, 15 }  ,fill opacity=1 ] (259.9,256.51) .. controls (238.59,189.42) and (244.28,127.91) .. (272.86,118.63) .. controls (272.97,118.6) and (273.09,118.56) .. (273.2,118.52) -- (312.74,241.44) -- cycle ;
%Shape: Pie [id:dp10266483730727005] 
\draw  [draw opacity=0][fill={rgb, 255:red, 184; green, 139; blue, 28 }  ,fill opacity=1 ] (299,273.59) .. controls (294.47,263.76) and (290.12,252.85) .. (286.21,241.21) .. controls (269.58,191.8) and (267.03,148.06) .. (280.51,143.52) .. controls (280.88,143.4) and (281.25,143.31) .. (281.63,143.24) -- (310.62,233) -- cycle ;
%Shape: Pie [id:dp5993089550279873] 
\draw  [draw opacity=0][fill={rgb, 255:red, 184; green, 139; blue, 28 }  ,fill opacity=1 ] (403.18,214.89) .. controls (399.67,230.11) and (364.02,252.4) .. (317.31,267.57) .. controls (311.62,269.42) and (306.01,271.08) .. (300.51,272.56) -- (308.53,240.54) -- cycle ;
%Shape: Pie [id:dp5876965449293687] 
\draw  [draw opacity=0][fill={rgb, 255:red, 180; green, 182; blue, 92 }  ,fill opacity=1 ] (353.22,228.84) .. controls (354.17,239.23) and (339.55,252.3) .. (318.83,259.03) .. controls (313.73,260.68) and (308.7,261.81) .. (303.94,262.44) -- (312.56,239.7) -- cycle ;
%Shape: Pie [id:dp6120653756991667] 
\draw  [draw opacity=0][fill={rgb, 255:red, 180; green, 182; blue, 92 }  ,fill opacity=1 ] (301.89,263.57) .. controls (298.6,258.11) and (295.64,251.61) .. (293.31,244.45) .. controls (285.76,221.19) and (287.84,199.68) .. (297.95,196.4) .. controls (298.18,196.32) and (298.42,196.25) .. (298.66,196.2) -- (311.62,238.5) -- cycle ;
%Straight Lines [id:da2375618727418527] 
\draw [color={rgb, 255:red, 141; green, 47; blue, 15 }  ,draw opacity=1 ]   (427.15,208.06) -- (311.66,239.32) ;
%Straight Lines [id:da43833166976470306] 
\draw [color={rgb, 255:red, 141; green, 47; blue, 15 }  ,draw opacity=1 ]   (298.07,275.94) -- (311.82,238.94) ;
%Straight Lines [id:da8168641814227142] 
\draw [color={rgb, 255:red, 141; green, 47; blue, 15 }  ,draw opacity=1 ]   (273.2,118.52) -- (312.32,239.44) ;
%Shape: Pie [id:dp3584215499566077] 
\draw  [draw opacity=0][fill={rgb, 255:red, 235; green, 132; blue, 35 }  ,fill opacity=1 ] (266.03,275.12) .. controls (263.82,275.18) and (261.59,275.21) .. (259.33,275.21) .. controls (239.28,275.21) and (221.16,272.87) .. (208.13,269.11) -- (259.33,254.81) -- cycle ;
\end{tikzpicture}

这实际上给出了一些幼稚的东西:

在此处输入图片描述

答案1

\documentclass[tikz, border=1cm]{standalone}
\begin{document}
\pagecolor{black}
\begin{tikzpicture}
\foreach \i in {0,...,100}{
\draw[orange, opacity=0.1, line width=15pt] (0,0) -- ([shift={(360*rnd:0.9*rnd)}]45:3); \draw (0,0);
}
\foreach \i in {0,...,100}{
\draw[orange, opacity=0.1, line width=15pt] (0,0) -- ([shift={(360*rnd:0.8*rnd)}]-30:2.5); \draw (0,0);
}
\foreach \i in {0,...,100}{
\draw[orange, opacity=0.04, line width=15pt] (0,0) -- ([shift={(360*rnd:0.4*rnd)}]110:3.5); \draw (0,0);
}
\foreach \i in {0,...,100}{
\draw[orange, opacity=0.04, line width=15pt] (0,0) -- ([shift={(360*rnd:0.4*rnd)}]-110:3.5); \draw (0,0);
}
\foreach \i in {0,...,100}{
\draw[orange, opacity=0.04, line width=15pt] (0,0) -- ([shift={(360*rnd:0.6*rnd)}]-170:3); \draw (0,0);
}
\fill (0,0) circle[radius=2cm];
\end{tikzpicture}
\end{document}

带有放射状橙色光斑的黑色圆圈

相关内容