Skip to content

Commit

Permalink
pre 2022.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomusy committed Dec 15, 2022
1 parent 70a16da commit 339c4c2
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 20 deletions.
5 changes: 2 additions & 3 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- added `basegrid.extract_cells_on_cylinder()`
- added `count_vertices()` method
- added `copy_data_from()` method to transfer all cell and point data from an object to another.
- fixed `metadata` association

---
### `pointcloud.py`
Expand Down Expand Up @@ -90,9 +91,7 @@ examples/pyplot/fit_curve.py
examples/pyplot/histo_2d_a.py
examples/pyplot/histo_2d_b.py
examples/other/flag_labels2.py

-------------------------
### Deleted
examples/volumetric/image_false_colors.py

### Broken
examples/simulations/lorenz.py
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/fitspheres2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

plt = Plotter()

msh = Mesh(dataurl+"cow.vtk").alpha(0.3)
msh = Mesh(dataurl+"cow.vtk").c("cyan7")

pts1, pts2, vals, cols = [], [], [], []

Expand All @@ -29,7 +29,7 @@
plt += msh
plt += Points(pts1, c=cols)
plt += Lines(pts1, pts2, c="black")
plt += histogram(vals, xtitle='radius', xlim=[0,2]).pos(-1,0.5,-1)
plt += histogram(vals, xtitle='radius', xlim=[0,2]).as2d(pos="bottom-left")
plt += __doc__

plt.show().close()
7 changes: 5 additions & 2 deletions examples/other/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ echo
echo Running clone2d.py
python3 clone2d.py

echo Running flag_labels.py
python3 flag_labels.py
echo Running flag_labels1.py
python3 flag_labels1.py

echo Running flag_labels2.py
python3 flag_labels2.py

echo Running icon.py
python3 icon.py
Expand Down
2 changes: 1 addition & 1 deletion examples/simulations/pendulum_ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def derivs(state, t):
l1 = Line([[0,0], P1[i], P2[i]]).lw(7).c("blue2", 1.0)
l2 = Line([[0,0], P1[j], P2[j]]).lw(6).c("blue2", 0.4)
l3 = Line([[0,0], P1[k], P2[k]]).lw(5).c("blue2", 0.2)
plt.show(l1, l2, l3, ax, zoom=1.4).clear()
plt.clear().show(l1, l2, l3, ax, zoom=1.4)
pb.print()

plt.interactive().close()
Expand Down
2 changes: 1 addition & 1 deletion examples/volumetric/numpy2volume2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
data_matrix[30:50, 30:60, 30:70] = 2
data_matrix[50:69, 60:79, 70:89] = 3

vol = Volume(data_matrix, c=['white','b','g','r'], mapper='gpu')
vol = Volume(data_matrix, c=['white','b','g','r'], mode=1)
vol.add_scalarbar3d()
vol.print()

Expand Down
20 changes: 11 additions & 9 deletions vedo/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def __init__(
tact = vedo.utils.trimesh2vedo(inputobj)
self._data = tact.polydata()

elif "meshio" in inputtype: # meshio-4.0.11
elif "meshio" in inputtype:
if len(inputobj.cells):
mcells = []
for cellblock in inputobj.cells:
Expand All @@ -169,14 +169,16 @@ def __init__(
self._data.GetPointData().AddArray(vdata)
except AssertionError:
print("Could not add meshio point data, skip.")
try:
if len(inputobj.cell_data):
for k in inputobj.cell_data.keys():
vdata = numpy2vtk(inputobj.cell_data[k])
vdata.SetName(str(k))
self._data.GetCellData().AddArray(vdata)
except AssertionError:
print("Could not add meshio cell data, skip.")
# try:
# if len(inputobj.cell_data):
# for k in inputobj.cell_data.keys():
# #print(inputobj.cell_data)
# exit()
# vdata = numpy2vtk(inputobj.cell_data[k])
# vdata.SetName(str(k))
# self._data.GetCellData().AddArray(vdata)
# except AssertionError:
# print("Could not add meshio cell data, skip.")

elif "meshlab" in inputtype:
self._data = vedo.utils.meshlab2vedo(inputobj)
Expand Down
2 changes: 1 addition & 1 deletion vedo/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3229,7 +3229,7 @@ def add_inset(self, *actors, **options):
self.widgets.append(widget)
return widget

def clear(self, at=None, render=True, deep=False):
def clear(self, at=None, deep=False, render=False):
"""Clear the scene from all meshes and volumes."""
if at is not None:
renderer = self.renderers[at]
Expand Down
5 changes: 5 additions & 0 deletions vedo/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,11 @@ def as2d(self, scale=1, pos="center", padding=0.05):
"""
x0, x1 = self.xbounds()
y0, y1 = self.ybounds()
pp = self.pos()
x0 -= pp[0]
x1 -= pp[0]
y0 -= pp[1]
y1 -= pp[1]

if not utils.is_sequence(padding):
padding = (padding, padding)
Expand Down
2 changes: 1 addition & 1 deletion vedo/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
_version='2022.4.1.dev10'
_version='2022.4.2'

0 comments on commit 339c4c2

Please sign in to comment.