Skip to content

Commit 88d4676

Browse files
committed
Add scripting example
1 parent 06e9630 commit 88d4676

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

slides/slides.html

+22
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,28 @@ <h1>Exercise 4</h1>
211211
width=1000
212212
class="centObj"> <source src="../img/membrane_animation.ogv" type="video/ogg"> </video></p>
213213
</div>
214+
<div id="exercise-5" class="slide section level1">
215+
<h1>Exercise 5</h1>
216+
<p>In <code>Tools/Python Shell</code></p>
217+
<pre><code>from paraview.simple import *
218+
sphere = Sphere()
219+
Show()
220+
Render()
221+
ResetCamera()</code></pre>
222+
<p>we can create a filter</p>
223+
<pre><code>Hide()
224+
shrink = Shrink()
225+
Show()
226+
Render()</code></pre>
227+
<p>we can branch the pipeline</p>
228+
<pre><code>wireframe = ExtractEdges(Input=sphere)
229+
Show()
230+
Render()</code></pre>
231+
<p>or modify the properties of the sphere</p>
232+
<pre><code>sphere.ThetaResolution = 100
233+
sphere.PhiResolution = 50
234+
Render()</code></pre>
235+
</div>
214236
<div id="references" class="slide section level1">
215237
<h1>References</h1>
216238
<ul>

slides/slides.md

+31
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,37 @@ And the output video would be
204204
<source src="../img/membrane_animation.ogv" type="video/ogg">
205205
</video>
206206

207+
------------------
208+
209+
# Exercise 5
210+
211+
In ``Tools/Python Shell``
212+
213+
from paraview.simple import *
214+
sphere = Sphere()
215+
Show()
216+
Render()
217+
ResetCamera()
218+
219+
we can create a filter
220+
221+
Hide()
222+
shrink = Shrink()
223+
Show()
224+
Render()
225+
226+
we can branch the pipeline
227+
228+
wireframe = ExtractEdges(Input=sphere)
229+
Show()
230+
Render()
231+
232+
or modify the properties of the sphere
233+
234+
sphere.ThetaResolution = 100
235+
sphere.PhiResolution = 50
236+
Render()
237+
207238

208239
------------------
209240

0 commit comments

Comments
 (0)