-
Notifications
You must be signed in to change notification settings - Fork 1
/
techcon_2022_pyvista.tex
489 lines (387 loc) · 12.9 KB
/
techcon_2022_pyvista.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Ansys Techcon 2022 - PyVista – Visualizing CAE and Results with Python
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[t]{beamer}
\usetheme{Ansys2022}
\usepackage{animate}
\usepackage{svg}
\usepackage{bbding,pifont}
\usepackage{minted}
\usepackage{xcolor}
\usepackage{pdfpages}
\usepackage{listings}
\usepackage{hyperref}
\usepackage{tikz}
\usetikzlibrary{intersections}
\usetikzlibrary{shapes.geometric, arrows,positioning}
\usepackage[edges]{forest}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=cyan,
}
\urlstyle{same}
\setbeamercolor{background canvas}{bg=}
\definecolor{bleudefrance}{rgb}{0.19, 0.55, 0.91}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\tikzset{
startstop/.style={
rectangle,
rounded corners,
minimum width=3cm,
minimum height=0.75cm,
align=center,
draw=black,
fill=ANSYS@Gold,
},
process/.style={
rectangle,
minimum width=3cm,
minimum height=0.75cm,
align=center,
draw=black,
fill=ANSYS@Blue,
text=white,
},
decision/.style={
diamond,
aspect=4,
minimum width=3cm,
minimum height=1cm,
align=center,
draw=black,
fill=ANSYS@Blue,
text=white,
},
arrow/.style={thick,->,>=stealth},
dec/.style={
ellipse,
align=center,
draw=black,
fill=ANSYS@Bronze,
},
}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Title Slide
\title{PyVista \\
Visualizing CAE Results with Python}
%% \subtitle{}
\author{Alex Kaszynski}
\date{\today}
\titleframe{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Table of contents
\begin{frame}{Table of Contents}
\tableofcontents
\vspace{200pt} %% force top tight
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{PyVista - Introduction}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{PyVista - Introduction}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\vspace{-10pt}
\inputminted[fontsize=\footnotesize]{python}{code/pv_example1.py}
\end{column}
\begin{column}{.4\textwidth}
\vspace{-20pt}
\centering
\includegraphics[height=0.2\textheight]{figures/pyvista_logo.png}
\end{column}
\end{columns}
\vspace{5pt}
PyVista allows you to rapidly load meshes and handles much of the “grunt
work” of setting up plots, connecting classes and pipelines, and cleaning up
plotting windows.
\vspace{5pt}
\begin{exampleblock}{PyVista allows you to:}
\begin{itemize}
\item Easily load a wide variety of datasets and file types.
\item Leverage powerful VTK filters and perform complex data operations.
\item Quickly set up simple or complex plots.
\end{itemize}
\end{exampleblock}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{PyVista - Popularity and Growth}
\vspace{-15pt}
\begin{center}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\small
\begin{itemize}
\item Already the most popular 3d visualization library on PyPI.
\item Designed not just for visualization, but for scientific
visualization focused on data post-processing, file IO, and
interoperability with other libraries.
\end{itemize}
\vspace{10pt}
\href{https://pyviz.org/tools.html}{\includegraphics[width=1.1\textwidth]{figures/overview_sciviz.png}}
\end{column}
\begin{column}{.5\textwidth}
\vspace{-5pt}
\centering
\includegraphics[width=0.9\textwidth]{figures/overview-graph.png}
\end{column}
\end{columns}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Where is it already used?}
\begin{frame}
\frametitle{PyVista - Current Usage}
\vspace{-8pt}
PyVista is already being used by:
\vspace{-8pt}
\begin{columns}[T]
\begin{column}{.3\textwidth}
\begin{exampleblock}{ACE \& Partners}
\inputminted[fontsize=\tiny]{python}{code/dpf_simple.py}
\centering
\href{https://www.padtinc.com/2022/07/18/ansys-scripting-python-p1-solve-post/}{\includegraphics[width=0.95\textwidth]{figures/dpf_simple.png}}
\end{exampleblock}
\end{column}
\begin{column}{.3\textwidth}
\begin{exampleblock}{PyAnsys}
\inputminted[fontsize=\tiny]{python}{code/pymapdl_eo_disc.py}
\centering
\href{https://github.com/pyansys/ray-segments-pyvista}{\includegraphics[width=0.95\textwidth]{figures/pymapdl_eo_disc.png}}
\end{exampleblock}
\end{column}
\begin{column}{.3\textwidth}
\begin{exampleblock}{OnScale}
\inputminted[fontsize=\tiny]{python}{code/onscale_pyvista.py}
\centering
\href{https://github.com/pyansys/ray-segments-pyvista}{\includegraphics[width=0.95\textwidth]{figures/onscale_pyvista.png}}
\end{exampleblock}
\end{column}
\end{columns}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Quick Example}
\begin{frame}
\frametitle{Quick Example - Path Operation}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\vspace{-15pt}
\inputminted[fontsize=\footnotesize]{python}{code/path_op.py}
\end{column}
\begin{column}{.5\textwidth}
\vspace{-15pt}
\centering
\includegraphics[width=0.75\textwidth]{figures/path_op.png}
\end{column}
\end{columns}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Quick Example - Path Operation vs PyMAPDL}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\vspace{-15pt}
\inputminted[fontsize=\footnotesize]{python}{code/path_op_vs_pymapdl.py}
\end{column}
\begin{column}{.5\textwidth}
\vspace{-15pt}
\centering
\includegraphics[width=1.0\textwidth]{figures/path_op_vs_pymapdl.png}
\end{column}
\end{columns}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Comparison - VTK vs. PyVista}
\begin{frame}
\frametitle{Comparison - VTK vs. PyVista}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\vspace{-15pt}
\inputminted[fontsize=\footnotesize]{python}{code/vtk_example.py}
\end{column}
\begin{column}{.5\textwidth}
\vspace{-15pt}
\inputminted[fontsize=\footnotesize]{python}{code/pv_example.py}
\begin{center}
\includegraphics[width=0.9\textwidth]{figures/pv_example.png}
\end{center}
\end{column}
\end{columns}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\transitionframe{Getting Started}
\section{Getting Started}
\begin{frame}
\frametitle{Getting Started}
\tableofcontents[currentsection]
\vspace{200pt} %% force top tight
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Installation}
\begin{frame}[fragile=singleslide]
\frametitle{Installation}
\vspace{-10pt}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\vspace{-10pt}
\begin{exampleblock}{pip}
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
pip install pyvista
\end{lstlisting}
\end{exampleblock}
\end{column}
\begin{column}{.5\textwidth}
\vspace{-10pt}
\begin{exampleblock}{conda}
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
conda install -c conda-forge pyvista
\end{lstlisting}
\end{exampleblock}
\end{column}
\end{columns}
\vspace{5pt}
\centering
\href{https://asciinema.org/a/507562}{\includegraphics[width=0.76\textwidth]{figures/install_pyvista.png}}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\transitionframe{Examples}
\section{Examples}
\begin{frame}
\frametitle{Examples}
\tableofcontents[currentsection]
\vspace{200pt} %% force top tight
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Basic Plot}
\begin{frame}
\frametitle{Examples - Basic Plot}
\begin{center}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\inputminted[fontsize=\footnotesize]{python}{code/basic_usage.py}
\end{column}
\begin{column}{.5\textwidth}
\centering
\includegraphics[width=1.0\textwidth]{figures/basic_usage.png}
\end{column}
\end{columns}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Basic Volumetric Plot}
\begin{frame}
\frametitle{Examples - Basic Volumetric Plot}
\begin{center}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\inputminted[fontsize=\footnotesize]{python}{code/basic_usage2.py}
\end{column}
\begin{column}{.5\textwidth}
\centering
\includegraphics[width=1.0\textwidth]{figures/basic_usage2.png}
\end{column}
\end{columns}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Filters}
\begin{frame}
\frametitle{Examples - Filters}
\vspace{-10pt}
\begin{center}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\inputminted[fontsize=\footnotesize]{python}{code/filters.py}
\end{column}
\begin{column}{.5\textwidth}
\centering
\includegraphics[width=1.0\textwidth]{figures/filters.png}
\end{column}
\end{columns}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Examples - Widgets}
\begin{center}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\inputminted[fontsize=\footnotesize]{python}{code/widgets_ex.py}
\end{column}
\begin{column}{.5\textwidth}
\vspace{-25pt}
\centering
\includegraphics[width=1.0\textwidth]{figures/sphx_glr_d_multi-slider-widget_001}
\end{column}
\end{columns}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{PyInstaller and PyQT}
\begin{frame}
\frametitle{Examples - PyInstaller and PyQT}
\vspace{-15pt}
\begin{center}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\small
\begin{itemize}
\item Use PyInstaller and PyQT or PySide to create a standalone application.
\item Multi-platform. Build on the OS you intend to deploy.
\item Compatible with GitHub Actions and can be automated.
\item Deploy as using an installer like NSIS.
\end{itemize}
\vspace{5pt}
\inputminted[fontsize=\footnotesize]{bash}{code/pyinstaller.py}
\end{column}
\begin{column}{.5\textwidth}
%% \vspace{-25pt}
\centering
\includegraphics[width=1.0\textwidth]{figures/VesselVio.png}
\end{column}
\end{columns}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Examples - Documentation with Sphinx}
\vspace{-15pt}
\begin{center}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\small
\begin{itemize}
\item PyVista supports the Sphinx documentation generator.
\item Allows you to generate static and interactive documentation.
\item Place code snippets directly in the documentation as examples.
\end{itemize}
\vspace{5pt}
\inputminted[fontsize=\footnotesize]{bash}{code/sphinx_conf.py}
\end{column}
\begin{column}{.5\textwidth}
\vspace{-5pt}
\centering
\href{https://docs.pyvista.org/}{\includegraphics[width=0.9\textwidth]{figures/sphinx.png}}
\end{column}
\end{columns}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Tutorial}
\begin{frame}
\frametitle{Tutorial}
The \href{https://tutorial.pyvista.org}{PyVista Tutorial} contains a variety of lessons to help you get started with PyVista. The first lessons include:
\begin{itemize}
\item Introduction - Using PyVista for 3D Visualization within Python.
\item Reading and plotting 3D data using the PyVista module and external files.
\item Learn the basics of the PyVista data types and how to open common 3D file formats to visualize the data in 3D.
\item Demonstrate many features of the PyVista plotting API to create compelling 3D visualizations and touch on animations.
\item Demonstrate the PyVista filters API to perform mesh analysis and alteration.
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lastframe{}
\end{document}