From f0254fff1f4fdc4eccbb2ed93e8bae91a95d9437 Mon Sep 17 00:00:00 2001 From: marcomusy Date: Wed, 24 Aug 2022 18:36:23 +0200 Subject: [PATCH] comment --- docs/changes.md | 18 +++++++++++++++--- examples/other/pymeshlab2.py | 4 ++-- vedo/utils.py | 23 +++++++++++++++++++++-- vedo/version.py | 2 +- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/docs/changes.md b/docs/changes.md index 19cbee63..a2b0709e 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -1,6 +1,6 @@ ## Main changes -- pep8 parsing with pylint and general cleanup of the code. +- `pep8` parsing with pylint and general cleanup of the code. - `Volume(np_array)` does not need array to be transposed anymore. **Warning: this may cause flipping of the x-z axes!** --- @@ -14,7 +14,8 @@ ### `pointcloud.py` - bug fix in `clone()` - added `labels2D()` -- added logscale for `cmap(..., logscale=True)` +- added logscale for colormapping in method `cmap(..., logscale=True)` +- added explicit label formatting for scalarbars, @XushanLu --- ### `mesh.py` @@ -56,13 +57,24 @@ ## Examples ### New/Revised +examples/basic/input_box.py +examples/basic/pca_ellipse.py +examples/advanced/capping_mesh.py +examples/volumetric/numpy2volume2.py +examples/volumetric/numpy2volume1.py +examples/pyplot/fourier_epicycles.py +examples/pyplot/histo_pca.py +examples/pyplot/histo_1d_b.py +examples/other/flag_labels.py +examples/other/remesh_tetgen.py +examples/other/pymeshlab2.py ### Deleted ### Broken examples/basic/multiwindows2.py examples/simulations/lorenz.py - +examples/simulations/orbitals.py diff --git a/examples/other/pymeshlab2.py b/examples/other/pymeshlab2.py index 7711b9ec..30db63a3 100644 --- a/examples/other/pymeshlab2.py +++ b/examples/other/pymeshlab2.py @@ -1,7 +1,7 @@ """pymeshlab interoperability example: Surface reconstruction by ball pivoting""" import pymeshlab # pip install pymeshlab==2021.10 -import vedo +import vedo pts = vedo.Mesh(vedo.dataurl+'cow.vtk').points() # numpy array of vertices @@ -11,7 +11,7 @@ ms.add_mesh(m) p = pymeshlab.Percentage(2) -ms.surface_reconstruction_ball_pivoting(ballradius=p) +ms.generate_surface_reconstruction_ball_pivoting(ballradius=p) # ms.compute_normals_for_point_sets() mlab_mesh = ms.current_mesh() diff --git a/vedo/utils.py b/vedo/utils.py index f6035963..44b02077 100644 --- a/vedo/utils.py +++ b/vedo/utils.py @@ -1735,10 +1735,29 @@ def vtkCameraToK3D(vtkcam): def makeTicks(x0, x1, N=None, labels=None, digits=None, logscale=False, useformat=""): - """Internal use.""" - # useformat eg: ":.2f", check out https://mkaz.blog/code/python-string-format-cookbook/ + """ + Generate numeric labels for the [x0, x1] range. + + The format specifier could be in the format: + + :[[fill]align][sign][#][0][width][,][.precision][type] + where, the options are: + + fill = any character + align = < | > | = | ^ + sign = + | - | " " + width = integer + precision = integer + type = b | c | d | e | E | f | F | g | G | n | o | s | x | X | % + + E.g.: useformat=":.2f" + """ # Copyright M. Musy, 2021, license: MIT. + # + # useformat eg: ":.2f", check out: + # https://mkaz.blog/code/python-string-format-cookbook/ + # https://www.programiz.com/python-programming/methods/built-in/format if x1 <= x0: # vedo.printc("Error in makeTicks(): x0 >= x1", x0,x1, c='r') diff --git a/vedo/version.py b/vedo/version.py index 78f9566c..0f216477 100644 --- a/vedo/version.py +++ b/vedo/version.py @@ -1 +1 @@ -_version='2022.2.3.dev14' +_version='2022.3.0'