Skip to content

Commit

Permalink
small fixees
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomusy committed May 4, 2021
1 parent e594d67 commit 71ae60f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
9 changes: 4 additions & 5 deletions docs/changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Main changes


- general improvements to the `vedo` command line
- `colorcet` [colormaps](https://colorcet.holoviz.org) are directly usable in `vedo`.
Check example `basic/mesh_custom.py`
Expand All @@ -14,9 +15,10 @@ Check example `basic/mesh_custom.py`
`vedo --info some_image.jpg https://vedo.embl.es/examples/data/porsche.ply`

- pressing `shift-A` toggles antialiasing for the whole rendering window
- pressing `shift-D` toggles depth-peeling algorithm (to visualize transparent object)
- pressing `shift-D` toggles depth-peeling algorithm for the current renderer

- antialiasing set by default on vtk9
- balloon-style flags are disabled because of a bug in vtk9.

---
### `base.py`
Expand All @@ -26,8 +28,8 @@ Check example `basic/mesh_custom.py`
### `addons.py`
- added `addSplineTool()` to interactively spline points in space
- added `labelRotation` in addScalarBar3D
- added `xAxisRotation` to rotate the whole axis (ticks and labels)
- added `xShiftAlongY` keywords in `Axes` to slide the whole axis position along another axis
- added `xAxisRotation` to rotate the whole axis (ticks and labels)
- `addScalarBar3D()` can now render categorical data

---
Expand Down Expand Up @@ -57,9 +59,6 @@ Check example `basic/mesh_custom.py`
### `pointcloud.py`
- added `cutWithBox()`, `cutWithLine()`, `cutWithSphere()` and `cutWithCylinder()` methods

---
### `pyplot.py`

---
### `shapes.py`
- fixed small bug in `Glyph`
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/timer_callback2.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def initialize(self):
return self

def show(self, *args, **kwargs):
self.plotter.show(*args, **kwargs)
return self
plt = self.plotter.show(*args, **kwargs)
return plt

def _buttonfunc(self):
if self.timerId is not None:
Expand Down
6 changes: 3 additions & 3 deletions examples/basic/colorcubes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Show a cube for each available color name"""
print(__doc__)
from vedo import Cube, Text2D, show, settings, interactive
from vedo import Cube, Text2D, show, settings
from vedo.colors import colors
from operator import itemgetter

Expand All @@ -17,6 +17,7 @@
cbs.append([tname, cb])
print("click on any cube and press i or I")
plt1= show(cbs, N=len(cbs), azimuth=.2, size='full', title="matplotlib colors", interactive=0)
plt1.render()

# sort by name (bootstrap5 colors):
sorted_colors2 = sorted(colors.items(), key=itemgetter(0))
Expand All @@ -28,6 +29,5 @@
cbs.append([cname, cb])
plt2= show(cbs, shape=(11,9), azimuth=.2, size=(800,1000), title="bootstrap5 colors", new=True)

interactive()
plt1.close()
plt2.close()
plt1.close()
2 changes: 1 addition & 1 deletion examples/pyplot/customAxes3.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
xyShift=0.2, # move xy plane 20% along z
yzShift=0.2, # move yz plane 20% along x
zxShift=0.2, # move zx plane 20% along y
)
)

show(sph, axs, __doc__).close()
12 changes: 8 additions & 4 deletions vedo/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2577,7 +2577,7 @@ def _keypress(self, iren, event):
self.escaped = True # window will be escaped ASAP
iren.ExitCallback()
return

elif key == "F1":
vedo.printc('\nExecution aborted. Exiting python kernel now.', c='r')
#settings.plotter_instance.close()
Expand Down Expand Up @@ -3001,9 +3001,13 @@ def _keypress(self, iren, event):
acts = self.getMeshes()
for ia in acts:
if ia.GetPickable() and isinstance(ia, vedo.Mesh):
ia.computeNormals()
intrp = (ia.GetProperty().GetInterpolation()+1)%3
ia.GetProperty().SetInterpolation(intrp)
ia.computeNormals(cells=False)
intrp = ia.GetProperty().GetInterpolation()
# print(intrp, ia.GetProperty().GetInterpolationAsString())
if intrp > 0:
ia.GetProperty().SetInterpolation(0) #flat
else:
ia.GetProperty().SetInterpolation(2) #phong

elif key == "n": # show normals to an actor
if self.clickedActor in self.getMeshes():
Expand Down

0 comments on commit 71ae60f

Please sign in to comment.