如何消除 beamer 中 tikzpicture 的阴影

如何消除 beamer 中 tikzpicture 的阴影

我制作了一张 tikzpicture,我想制作阴影形状,但是当我到达包含图形的页面时,我发现所有形式的阴影已经存在,因此有一个解决方案可以让它们与图形一起出现,因为我在同一个图形中也有动画,知道它是 beamer 中的演示文稿。

谢谢

\begin{tikzpicture}
\filldraw[rounded corners=5pt,fill=blue!30!white, draw=blue!50!white,blur shadow={shadow blur steps=10},visible on=<4->] (8,1.833) rectangle (14.5,5);
\filldraw[rounded corners=5pt,fill=blue!15!white, draw=blue!30!white,blur shadow={shadow blur steps=5},visible on=<4->] (9.25,4.75) rectangle  node[text width=2.5cm,align=center,visible on=<4->] {\textbf{Modélisation}}(13.25,5.25);
\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,blur shadow={shadow blur steps=5},visible on=<5->] (8.333,3.5) rectangle  node[text width=2.5cm,align=center,visible on=<5->] {\small Poids \& poussée d’Archimède\normalsize }(11.0833,4.5);
\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,blur shadow={shadow blur steps=5},visible on=<6->] (11.4166,3.5) rectangle  node[text width=2.5cm,align=center,visible on=<6->] {\small Dynamique\normalsize }(14.1666,4.5);

\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,blur shadow={shadow blur steps=5},visible on=<7->] (8.333,2.166) rectangle  node[text width=2.5cm,align=center,visible on=<7->] {\small Propulsion\normalsize }(11.0833,3.166);
\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,blur shadow={shadow blur steps=5},visible on=<8->] (11.4166,2.166) rectangle  node[text width=2.5cm,align=center,visible on=<8->] {\footnotesize Forces \& moments aérodynamiques\normalsize }(14.1666,3.166);


\draw [dashed,rounded corners=2.5mm,ultra thick, -latex,draw=blue!30!white,out=90,in=90,looseness=5,visible on=<9->] (8,3.4166)--(4.25,3.4166)--(4.25,2.75);



\filldraw[rounded corners=5pt,fill=blue!30!white, draw=blue!50!white,blur shadow={shadow blur steps=10},visible on=<10->] (1,-1.25) rectangle (7.5,2.5);
\filldraw[rounded corners=5pt,fill=blue!15!white, draw=blue!30!white,blur shadow={shadow blur steps=5},visible on=<10->] (2.25,2.25) rectangle  node[text width=2.5cm,align=center,visible on=<10->] {\textbf{Commande}}(6.25,2.75);
\draw[draw=blue!50!white,line width=0.35mm,visible on=<10->] (4.25,2.25)--(4.25,-1.25);
\filldraw[rounded corners=5pt,fill=blue!15!white, draw=blue!30!white,blur shadow={shadow blur steps=5},visible on=<11->] (1.625,1.75) rectangle  node[text width=2cm,align=center,visible on=<11->] {\textit{Linéaire}}(3.625,2.25);
\filldraw[rounded corners=5pt,fill=blue!15!white, draw=blue!30!white,blur shadow={shadow blur steps=5},visible on=<12->] (4.875,1.75) rectangle  node[text width=2cm,align=center,visible on=<12->] {\textit{Non-linéaire}}(6.875,2.25);

\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,blur shadow={shadow blur steps=5},visible on=<13->] (1.333,0.4166) rectangle  node[text width=2.5cm,align=center,visible on=<13->] {Linéarisation}(3.833,1.4166);
\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,blur shadow={shadow blur steps=5},visible on=<14->] (1.333,-0.9166) rectangle  node[text width=2.5cm,align=center,visible on=<14->] {Contrôle}(3.833,0.0833);


\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,blur shadow={shadow blur steps=5},visible on=<15->] (4.5833,0.4166) rectangle  node[text width=2.5cm,align=center,visible on=<15->] {Commandeg}(7.0833,1.4166);
\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,blur shadow={shadow blur steps=5},visible on=<16->] (4.5833,-0.9166) rectangle  node[text width=2.5cm,align=center,visible on=<16->] {Commandeg robuste}(7.0833,0.0833);
\end{tikzpicture}

答案1

问题是,beamer-overlay-styles通过将阴影设置opacity为 0,可以使物体不可见。但是,(模糊)阴影具有非零不透明度,这会覆盖invisible技巧中的不透明度。因此,只要节点或其他物体不可见,您就需要遮挡阴影。为此,我定义了一个样式blur shadow on,它接受两个参数,即叠加规范和模糊步骤。

\documentclass[xcolor=dvipsnames,10pt]{beamer}
\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{overlay-beamer-styles}
\begin{document}
\tikzset{blur shadow on/.style args={<#1> with #2 steps}{alt={<#1>{blur
shadow={shadow blur steps=#2}}{}}}}
\begin{frame}[t]
\frametitle{Shadow opacity} 
\centerline{\begin{tikzpicture}[scale=0.92] 
\filldraw[rounded corners=5pt,fill=blue!30!white, draw=blue!50!white,
blur shadow on={<4-> with 10 steps},
visible on=<4->] (8,1.833) rectangle (14.5,5);
\filldraw[rounded corners=5pt,fill=blue!15!white, draw=blue!30!white,
blur shadow on={<4-> with 5 steps},
visible on=<4->] (9.25,4.75) rectangle node[text
width=2.5cm,align=center,visible on=<4->,font=\bfseries] {Mod\'ulisation}(13.25,5.25);
\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,
blur shadow on={<5-> with 5 steps},
visible on=<5->] (8.333,3.5) rectangle node[text
width=2.5cm,align=center,visible on=<5->,font=\small] {Poids \& pouss\'e
d'Archim\'ede}(11.0833,4.5); 
\filldraw[rounded
corners=5pt,fill=blue!10!white, draw=blue!40!white,
blur shadow on={<6-> with 5 steps},
visible on=<6->] (11.4166,3.5) rectangle node[text
width=2.5cm,align=center,visible on=<6->,font=\small] {Dynamique}(14.1666,4.5);
\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,
blur shadow on={<7-> with 5 steps},
visible on=<7->] (8.333,2.166) rectangle node[text
width=2.5cm,align=center,visible on=<7->,font=\small] {Propulsion}(11.0833,3.166); 
\filldraw[rounded corners=5pt,fill=blue!10!white,
draw=blue!40!white,
blur shadow on={<8-> with 5 steps},
visible on=<8->]
(11.4166,2.166) rectangle node[text width=2.5cm,align=center,visible
on=<8->,font=\footnotesize]
{Forces \& moments a\'erodynamiques}(14.1666,3.166);
\draw [dashed,rounded corners=2.5mm,ultra thick,
-latex,draw=blue!30!white,out=90,in=90,looseness=5,visible on=<9->]
(8,3.4166)--(4.25,3.4166)--(4.25,2.75);
\filldraw[rounded corners=5pt,fill=blue!30!white, draw=blue!50!white,
blur shadow on={<10-> with 10 steps},
visible on=<10->] (1,-1.25) rectangle (7.5,2.5);
\filldraw[rounded corners=5pt,fill=blue!15!white, draw=blue!30!white,
blur shadow on={<10-> with 5 steps},
visible on=<10->] (2.25,2.25) rectangle node[text
width=2.5cm,align=center,visible on=<10->,font=\bfseries] {Commande}(6.25,2.75);
\draw[draw=blue!50!white,line width=0.35mm,visible on=<10->]
(4.25,2.25)--(4.25,-1.25); 
\filldraw[rounded corners=5pt,fill=blue!15!white,
draw=blue!30!white,
blur shadow on={<11-> with 5 steps},
visible on=<11->]
(1.625,1.75) rectangle node[text width=2cm,align=center,visible
on=<11->,font=\itshape]
{Lin\'aire}(3.625,2.25); 
\filldraw[rounded
corners=5pt,fill=blue!15!white, draw=blue!30!white,
blur shadow on={<12-> with 5 steps},
visible on=<12->] (4.875,1.75) rectangle node[text
width=2cm,align=center,visible on=<12->,font=\itshape] {Non-lin\'aire}(6.875,2.25);
\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,
blur shadow on={<13-> with 5 steps},
visible on=<13->] (1.333,0.4166) rectangle
node[text width=2.5cm,align=center,visible on=<13->] {Lin\'arisation}(3.833,1.4166); 
\filldraw[rounded corners=5pt,fill=blue!10!white,
draw=blue!40!white,
blur shadow on={<14-> with 5 steps},
visible on=<14->]
(1.333,-0.9166) rectangle node[text width=2.5cm,align=center,visible on=<14->]
{Contr\'ole}(3.833,0.0833);
\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,
blur shadow on={<15-> with 5 steps},
visible on=<15->] (4.5833,0.4166) rectangle
node[text width=2.5cm,align=center,visible on=<15->] {Commandeg}(7.0833,1.4166);
\filldraw[rounded corners=5pt,fill=blue!10!white, draw=blue!40!white,
blur shadow on={<16-> with 5 steps},
visible on=<16->] (4.5833,-0.9166) rectangle
node[text width=2.5cm,align=center,visible on=<16->] {Commandeg
robuste}(7.0833,0.0833); 
\end{tikzpicture}}
\end{frame}
\end{document}

在此处输入图片描述

请注意,我没有您的文档序言,这(可能是)图片太宽,并且您有一些奇怪的字符,我无法复制,只能用临时字符替换。

相关内容