diff --git a/docs/changes.md b/docs/changes.md index 6f52333b..e5bb993d 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -10,7 +10,7 @@ ### Broken Examples meshio_read.py - +navier-stokes_lshape.py diff --git a/examples/other/dolfin/run_all.sh b/examples/other/dolfin/run_all.sh index d38dbe77..4bfe0fb2 100755 --- a/examples/other/dolfin/run_all.sh +++ b/examples/other/dolfin/run_all.sh @@ -14,14 +14,14 @@ python3 calc_surface_area.py echo Running markmesh.py python3 markmesh.py -echo Running scalemesh.py -python3 scalemesh.py +# echo Running scalemesh.py +# python3 scalemesh.py -echo Running pi_estimate.py -python3 pi_estimate.py +# echo Running pi_estimate.py +# python3 pi_estimate.py -echo Running submesh_boundary.py -python3 submesh_boundary.py +# echo Running submesh_boundary.py +# python3 submesh_boundary.py echo Running demo_submesh.py python3 demo_submesh.py @@ -35,15 +35,9 @@ python3 elasticbeam.py echo Running magnetostatics.py python3 magnetostatics.py -echo Running curl2d.py -python3 curl2d.py - echo Running pointLoad.py python3 pointLoad.py -echo Running meshEditor.py -python3 meshEditor.py - echo Running nodal_u.py python3 nodal_u.py @@ -73,8 +67,8 @@ python3 ex07_stokes-iterative.py ###################################### -echo Running ft02_poisson_membrane.py -python3 ft02_poisson_membrane.py +# echo Running ft02_poisson_membrane.py +# python3 ft02_poisson_membrane.py echo Running ft04_heat_gaussian.py python3 ft04_heat_gaussian.py @@ -109,10 +103,3 @@ python3 awefem.py echo Running demo_eigenvalue.py python3 demo_eigenvalue.py -echo Running demo_auto-adaptive-poisson.py -python3 demo_auto-adaptive-poisson.py - - - - - diff --git a/examples/other/spherical_harmonics2.py b/examples/other/spherical_harmonics2.py deleted file mode 100644 index 268c012f..00000000 --- a/examples/other/spherical_harmonics2.py +++ /dev/null @@ -1,94 +0,0 @@ -""" -Morph one shape into another using spherical harmonics package shtools. - -In this example we morph a sphere into a octahedron and vice-versa. -""" -import numpy as np -from vedo import settings, Plotter, Points, Sphere, cos, dataurl, mag, sin, Mesh - -try: - import pyshtools - print(__doc__) -except ModuleNotFoundError: - print("Please install pyshtools to run this example") - print("Follow instructions at https://shtools.oca.eu/shtools") - exit(0) - - -########################################################## -N = 100 # number of sample points on the unit sphere -lmax = 15 # maximum degree of the sph. harm. expansion -rbias = 0.5 # subtract a constant average value -x0 = [0, 0, 0] # set object at this position -########################################################## - - -def makeGrid(shape, N): - rmax = 2.0 # line length - agrid, pts = [], [] - for th in np.linspace(0, np.pi, N, endpoint=True): - lats = [] - for ph in np.linspace(0, 2 * np.pi, N, endpoint=True): - p = np.array([sin(th) * cos(ph), sin(th) * sin(ph), cos(th)]) * rmax - intersections = shape.intersect_with_line([0, 0, 0], p) - if len(intersections): - value = mag(intersections[0]) - lats.append(value - rbias) - pts.append(intersections[0]) - else: - lats.append(rmax - rbias) - pts.append(p) - agrid.append(lats) - agrid = np.array(agrid) - actor = Points(pts, c="k", alpha=0.4, r=1) - return agrid, actor - - -def morph(clm1, clm2, t, lmax): - """Interpolate linearly the two sets of sph harm. coeeficients.""" - clm = (1 - t) * clm1 + t * clm2 - grid_reco = clm.expand(lmax=lmax) # cut "high frequency" components - agrid_reco = grid_reco.to_array() - pts = [] - for i, longs in enumerate(agrid_reco): - ilat = grid_reco.lats()[i] - for j, value in enumerate(longs): - ilong = grid_reco.lons()[j] - th = np.deg2rad(90 - ilat) - ph = np.deg2rad(ilong) - r = value + rbias - p = np.array([sin(th) * cos(ph), sin(th) * sin(ph), cos(th)]) * r - pts.append(p) - return pts - -settings.use_depth_peeling = True - -plt = Plotter(shape=[2, 2], axes=3, interactive=0) - -shape1 = Sphere(alpha=0.2) -shape2 = Mesh(dataurl + "icosahedron.vtk").normalize().linewidth(1) -plt += shape2 - -agrid1, actorpts1 = makeGrid(shape1, N) - -plt.at(0).show(shape1, actorpts1) - -agrid2, actorpts2 = makeGrid(shape2, N) -plt.at(1).show(shape2, actorpts2) - -plt.camera.Zoom(1.2) - -clm1 = pyshtools.SHGrid.from_array(agrid1).expand() -clm2 = pyshtools.SHGrid.from_array(agrid2).expand() -# clm1.plot_spectrum2d() # plot the value of the sph harm. coefficients -# clm2.plot_spectrum2d() - -for t in np.arange(0, 1, 0.005): - act21 = Points(morph(clm2, clm1, t, lmax), c="r", r=4) - act12 = Points(morph(clm1, clm2, t, lmax), c="g", r=4) - - plt.at(2).show(act21, resetcam=False) - plt.at(3).show(act12) - plt.azimuth(2) - -plt.interactive().close() diff --git a/examples/volumetric/tet_cutMesh1.py b/examples/volumetric/tet_cut1.py similarity index 100% rename from examples/volumetric/tet_cutMesh1.py rename to examples/volumetric/tet_cut1.py diff --git a/examples/volumetric/tet_cutMesh2.py b/examples/volumetric/tet_cut2.py similarity index 100% rename from examples/volumetric/tet_cutMesh2.py rename to examples/volumetric/tet_cut2.py diff --git a/vedo/plotter.py b/vedo/plotter.py index f434f4b4..84d582b0 100644 --- a/vedo/plotter.py +++ b/vedo/plotter.py @@ -3832,11 +3832,13 @@ def _keypress(self, iren, event): if key in ["minus", "KP_Subtract"]: if not settings.use_parallel_projection and self.axes == 0: self.axes -= 1 # jump ruler doesnt make sense in perspective mode - addons.add_global_axes(axtype=(self.axes - 1) % 15, c=None) + bns = self.renderer.ComputeVisiblePropBounds() + addons.add_global_axes(axtype=(self.axes - 1) % 15, c=None, bounds=bns) else: if not settings.use_parallel_projection and self.axes == 12: self.axes += 1 # jump ruler doesnt make sense in perspective mode - addons.add_global_axes(axtype=(self.axes + 1) % 15, c=None) + bns = self.renderer.ComputeVisiblePropBounds() + addons.add_global_axes(axtype=(self.axes + 1) % 15, c=None, bounds=bns) self.interactor.Render() elif "KP_" in key or key in [ diff --git a/vedo/version.py b/vedo/version.py index 90f6261f..adb9d00a 100644 --- a/vedo/version.py +++ b/vedo/version.py @@ -1 +1 @@ -_version = '2023.4.5+dev1' +_version = '2023.4.5+dev2'