Skip to content

Commit

Permalink
small fix to visual.py
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomusy committed Feb 1, 2024
1 parent 1167fd1 commit cb44ad7
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
1 change: 1 addition & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,4 @@ meshquality.py
streamlines1.py


madcad2 blocks tsts
2 changes: 2 additions & 0 deletions tests/pipeline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pytest tests

cd $VEDODIR/tests/common && ./run_all.sh
cd $VEDODIR/tests/issues && ./run_all.sh
cd $VEDODIR/tests/snippets && ./run_all.sh

# EXAMPLES ##########################################################################
cd $VEDODIR/examples && time ./run_all.sh 2>&1 | tee $VEDOLOGFILE && alert "scan done."
Expand All @@ -63,6 +64,7 @@ cd $VEDODIR/examples/other/trimesh && ./run_all.sh

# DOLFIN #####################################################################
# conda create -n fenics -c conda-forge fenics
# conda activate fenics
# conda install conda-forge::mshr
cd $VEDODIR
conda activate fenics
Expand Down
11 changes: 11 additions & 0 deletions tests/snippets/run_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# source run_all.sh
#
echo Press Esc at anytime to skip example, F1 to interrupt

for f in *.py
do
echo "----------------------------------------"
echo "Processing $f script.."
python "$f"
done
22 changes: 11 additions & 11 deletions tests/snippets/test_closewindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@
printc('\nControl returned to terminal shell:', c='tomato', invert=1)
# ask('window is now unresponsive (press Enter here)', c='tomato', invert=1)

plt1.close_window()
plt1.close()

# window should now close, the Plotter instance becomes unusable
# but mesh objects still exist in it:
printc("Objects in first Plotter:", len(plt1.objects), '\nPress q again')
# plt1.show() # error here: window does not exist anymore. Cannot reopen.

# ##################################################################
# # Can now create a brand new Plotter and show the old object in it
# plt2 = Plotter(title='Second Plotter instance', pos=(500,0))
# plt2.show(plt1.objects[0].color('red'))
# Can now create a brand new Plotter and show the old object in it
plt2 = Plotter(title='Second Plotter instance', pos=(500,0))
plt2.show(plt1.objects[0].color('red'))

# ##################################################################
# # Create a third new Plotter and then close the second
# plt3 = Plotter(title='Third Plotter instance')
##################################################################
# Create a third new Plotter and then close the second
plt3 = Plotter(title='Third Plotter instance')

# plt2.close_window()
# printc('plt2.close_window() called')
plt2.close()
printc('plt2.close() called')

# plt3.show(Hyperboloid()).close()
plt3.show(Hyperboloid()).close()

# printc('done.')
printc('done.')
3 changes: 3 additions & 0 deletions tests/snippets/test_compare_fit1.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def fit_function(x, A, beta, B, mu, sigma):
h.add_legend()
h.show(zoom="tight")

if settings.dry_run_mode:
exit(0)

############################################# matplotlib
# Plot the histogram and the fitted function.
import matplotlib.pyplot as plt
Expand Down
4 changes: 2 additions & 2 deletions vedo/visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ def labels2d(
pr.ShadowOff()
pr.UseTightBoundingBoxOn()
pr.SetOrientation(angle)
pr.SetFontFamily(vtk.VTK_FONT_FILE)
pr.SetFontFamily(vtki.VTK_FONT_FILE)
fl = utils.get_font_path(font)
pr.SetFontFile(fl)
pr.SetFontSize(int(20 * scale))
Expand Down Expand Up @@ -2249,7 +2249,7 @@ def caption(
pra.SetLineWidth(lw)

pr = capt.GetCaptionTextProperty()
pr.SetFontFamily(vtk.VTK_FONT_FILE)
pr.SetFontFamily(vtki.VTK_FONT_FILE)
fl = utils.get_font_path(font)
pr.SetFontFile(fl)
pr.ShadowOff()
Expand Down

0 comments on commit cb44ad7

Please sign in to comment.