Releases: marcomusy/vedo
2024.5.2
Changes and Fixes
- add
magic-class
example - fix bug in
IsosurfaceBrowser
in #1064 - add
mesh.adjacency_list()
andgraph_ball()
methods by @sergei9838 - add
utils.circle_from_3points()
function. - add example
examples/other/iminuit2.py
- add
rotation=..
toArrow2D()
class - improvements to
applications.MorphPlotter
class - add
FlyOverSurface
class andexamples/basic/interaction_modes3.py
- add
mesh.extrude_and_trim_with()
method out of #1077 - fix reset clipping range in thumbnail generation in #1085
- add
mesh.euler_characteristic()
,mesh.genus()
andmesh.to_reeb_graph()
in #1084 - fix
reset_camera()
by @sergei9838 and Eric - fix handle empty axis for rotation #1113 by @JeffreyWardman
- fix minor bug in RoundedLine #1104 by @PinkMushroom
- fix avoid overwriting screenshots with "S" key #1100 by @j042
- add support for
meshlib
in https://doc.meshinspector.com/index.html - add relevant keyword options to
core.probe()
method - increase precision in writing obj files in #1119 by @ManuGraiph
- add
plotter.freeze()
to freeze interaction of current renderer in #1122 by @sergei9838 - add class
addons.ButtonWidget
to address issue #1138 - add typing annotations in submodules
- allow for dictionary input in Group and Assembly by @JeffreyWardman in #1057
- allow assembly to correctly index objects by @JeffreyWardman in #1062
- backwards compatibility in typing with python < 3.11 by @JeffreyWardman in #1093
- avoid overwriting screenshots with
"S"
key by @j042 in #1100 - minor bug in RoundedLine by @PinkMushroom in #1104
- bugfix: add tolerance to contains by @JeffreyWardman in #1105
- Mitigate issue #769: don't set backend to '2d' in IPython REPLs by @paulbrodersen in #1108
- handle empty axis for rotation by @JeffreyWardman in #1113
- Print position parameter as 'pos' by @adamltyson in #1134
Soft-breaking Changes
Changes that will break existing code whose fixing is trivial:
- remove
concatenate=True
keyword fromapply_transform()
discussed in #1111
Hard-breaking Changes
Changes that will break existing code and need active thinking and work to adapt
- None
New/Revised Examples
examples/basic/interaction_modes3.py
examples/basic/interaction_modes4.py
examples/basic/buttons3.py
examples/advanced/warp4b.py
examples/other/magic-class1.py
examples/other/iminuit2.py
examples/other/meshlib1.py
tests/issues/issue_1077.py
New Contributors
- @PinkMushroom made their first contribution in #1104
- @paulbrodersen made their first contribution in #1108
- @adamltyson made their first contribution in #1134
Full Changelog: v2024.5.1...v2024.5.2
2024.5.1
Changes and Fixes
- fixes to
extrude()
method thanks to @JeffreyWardman - add
utils.madcad2vedo
conversion as per #976 by @JeffreyWardman - add
utils.camera_to_dict()
- add
Axes(title_backface_color=...)
keyword - fix
labels()
andlabels2d()
- add
shapes.plot_scalar()
plot a scalar along a line. - add support for
tetgenpy
- add
transformations.compute_main_axes()
- add
transformations.__call__()
to apply a transformation - fix small bug in
pointcloud.distance_to()
- add
applications.MorphPlotter()
to morph a polygonal mesh to a target mesh - add
smooth_data()
to smooth/diffuse data attributes - add
shapes.Tubes()
- add
utils.Minimizer()
class - add
CellCenters(Points)
class - add
core.apply_transform_from_actor()
- add
add volume.slab()
- add
mesh.generate_random_points()
to generate random points onto a surface - add
tetmesh.generate_random_points()
to generate random points in a tet mesh - rename
integrate_arrays_over_domain()
tointegrate_data
- extend
volume.operation()
to support logic operations as per #1002 - add
pointcloud.relax_point_positions()
method - add
pointcloud.auto_distance()
method calculates the distance to the closest point in the same cloud of points. - fixed
mesh.collapse_edges()
after #992 - add
mesh.cut_closed_surface()
- fix
image.clone()
in #1011 - add
transformations.TransformInterpolator
class - add
Line.find_index_at_position()
finds the index of the line vertex that is closest to a point - add
visual.LightKit
class which provides "natural" lighting from 4 sources. - add
fast-simplification
example by @Louis-Pujol in #992 - add metadata "shape" to
volume.slice_plane()
in #1018 - fix
core.mark_boundaries()
method - add callbacks for cutters in #1020 and
examples/volumetric/slice_plane3.py
- add
utils.andrews_curves()
function. - add
transformations.LinearTransform.transpose()
method. - add
pointcloud.generate_segments()
to generate a continous line from un-ordered points in 3d - fix
assembly.__add__()
by @j042 in #1036 - small fix to
Ruler3D
class. - add
plotter.render_hidden_lines()
method - add slot for triangle strips in constructor
Mesh([verts, faces, lines, strips])
in #1019 - internally use "import vedo.vtkclasses as vtki" instead of "vtk" to avoid confusion
- add
join_with_strips()
in #1043 - improvements to
shapes.Ellipsoid()
and bug fixes in #978 by @daniel-a-diaz - improvements to
pointcloud.pca_ellipsoid()
and bug fixes - improvements to
pointcloud.pca_ellipse()
and bug fixes - fix Plotter
a
toggle keypress - fix viz on jupyter notebook as per #994
- fix
mesh.imprint()
- small fix to
applications.Slicer2DPlotter
- automatically apply the actor transform to an object actor that was moved manually (via eg "InteractorStyleTrackballActor") in #1045 and #1046 by @sergei9838
- add support to
RectilinearGrid
andStructuredGrid
data (experimental). - improvements to
RayCastPlotter
- add
visual.scalar_range()
to control mesh coloring. - fix
shapes.Text3D.text()
by @gioda - add
volume.isosurface_discrete()
method
Soft Breaking Changes
Changes that can break existing code whose fixing is trivial:
- change
clone2d(scale=...)
toclone2d(size=...)
- remove
shapes.StreamLines(object)
becomesobject.compute_streamlines()
- split
mesh.decimate()
intomesh.decimate()
,mesh.decimate_pro()
andmesh.decimate_binned()
as per #992 - modified
core.clean()
after #992 - remove
import_window()
for obj files and createload_obj()
by @zhouzq-thu in #891 - add
smooth_mls_12d(..., n=0)
to fix the number of neighbors in the smoothing - modified API for
mesh.binarize()
plotter.add_hover_legend()
now returns the id of the callback.- removed
settings.render_lines_as_tubes
andsettings.hidden_line_removal
, addplotter.render_hidden_lines()
method - fix
close()
,close_window()
is now obsolete and removed.
Hard Breaking Changes
Changes that will break existing code and need active thinking and work to adapt
- None
New/Revised Examples
examples/basic/sliders_hsv.py
examples/basic/buttons1.py
examples/basic/buttons2.py
examples/basic/input_box.py
examples/advanced/warp4b.py
examples/advanced/diffuse_data.py
examples/advanced/moving_least_squares1D.py
examples/volumetric/slab_vol.py
examples/volumetric/streamlines1.py
examples/volumetric/streamlines2.py
examples/volumetric/streamlines3.py
examples/volumetric/streamlines4.py
examples/volumetric/office.py
examples/volumetric/slice_plane1.py
examples/volumetric/slice_plane3.py
examples/volumetric/mesh2volume.py
examples/volumetric/read_volume3.py
examples/volumetric/rectl_grid1.py
examples/volumetric/struc_grid1.py
examples/volumetric/app_raycaster.py
examples/volumetric/isosurfaces1.py
examples/volumetric/isosurfaces2.py
examples/simulations/mag_field1.py
examples/pyplot/andrews_cluster.py
examples/other/madcad1.py
examples/other/tetgen1.py
examples/other/nelder-mead.py
examples/other/fast_simpl.py
tests/issues/issue_968.py
tests/issues/issue_1025.py
tests/issues/test_force_anim.py
tests/snippets/test_discourse_1956.py
tests/snippets/test_ellipsoid_main_axes.py
tests/snippets/test_compare_fit1.py
New Contributors
- @daizhirui made their first contribution in #983
- @JeffreyWardman made their first contribution in #988
- @PeterMitrano made their first contribution in #1000
- @Louis-Pujol made their first contribution in #1016
Full Changelog: v2023.5.0...v2024.5.1
2023.5.0
Main changes
Major internal refactoring.
Breaking changes
- rename internal list
plt.actors
which now becomeplt.objects
- rename
.points()
to property.vertices
. Hence:
mesh.points() -> mesh.vertices
mesh.points(newpoints) -> mesh.vertices = newpoints
- rename
.cell_centers()
to property.cell_centers
- rename
.faces()
to property.cells
- rename
.lines()
to property.lines
- rename
.edges()
to property.edges
- rename
.normals()
and split it into property.vertex_normals
and property.cell_normals
- rename
picture.Picture2D(...)
which becomesImage(...).clone2d()
(seeexamples/pyplot/embed_matplotlib.py
). - rename
Volume.probe_points()
which becomespoints.probe(volume)
- rename
Volume.probe_line()
which becomesline.probe(volume)
- rename
Volume.probe_plane()
which becomesplane.probe(volume)
- rename
file_io.load_transform()
.LinearTransform("file.mat")
substitutes it. - rename
transform_with_landmarks()
toalign_with_landmarks()
- rename
find_cells_in()
tofind_cells_in_bounds()
- rename
mesh.is_inside(pt)
moved tomesh.contains(pt)
- rename
Slicer2DPlotter
moved toapplication module.Slicer2DPlotter
- rename and moved method
voronoi()
topoints.generate_voronoi()
- rename class
Ruler
toRuler3D
Other changes
- improvements in how vtk classes are imported (allow lazy import)
- improvements to method
mesh.clone2d()
- improvements in
Slicer3DPlotter
thanks to @daniel-a-diaz in #925 - improvements in
applications.Browser
- add new
vedo.transformations.py
module. - add
plotter.pick_area()
thanks to @ZiguoAtGitHub and @RubendeBruin feedback. - add texture to npz files thanks to @zhouzq-thu in #918
- add background radial gradients
- add
utils.line_line_distance()
function - add
utils.segment_segment_distance()
function - add
plotter.initialize_interactor()
method - add object hinting by hovering mouse (see
flag_labels1.py
) - add
colors.lut_color_at(value)
the color of the lookup table at value. - add
.show(..., screenshot="myfile.png")
keyword - add
object.coordinates
same asobject.vertices
- add
move()
to move single points or objects - add
copy()
as alias toclone()
- add "Roll" to camera dictionary (thanks @baba-yaga )
- add
applications.Slicer3DTwinPlotter
thanks to @daniel-a-diaz - add radii feature to
smooth_mls_2d()
by @jo-mueller (now store results in arraysmesh.pointdata['MLSVariance']
andmesh.pointdata['MLSValidPoint']
) - passing a
vtkCamera
toshow(camera=...)
triggers a copy of the input which is therefore not muted by any subsequent interaction (thanks @baba-yaga )
Bug Fixes
- bug fix in
closest_point()
thanks to @goncalo-pt - bug fix in tformat thanks to @JohnsWor in #913
- bug fix in windows OS in timers callbacks thanks to @jonaslindemann
- bug fix to non linear tranforms mode. Now it can be instantiated with a dictionary
- bug fix in meshlab interface thanks to @JeffreyWardman in #924
- bug fix changed
mp = matplotlib.colormaps[name]
in colors.py
New/Revised Examples
examples/basic/buttons.py
examples/basic/input_box.py
examples/basic/sliders2.py
examples/basic/spline_tool.py
examples/basic/interaction_modes2.py
examples/advanced/timer_callback1.py
examples/advanced/timer_callback2.py
examples/advanced/warp4a.py
examples/advanced/warp4b.py
examples/pyplot/embed_matplotlib.py
examples/pyplot/plot_fxy2.py
examples/simulations/springs_fem.py
examples/simulations/lorenz.py
examples/volumetric/numpy2volume0.py
examples/volumetric/slicer1.py
examples/volumetric/tet_astyle.py
examples/volumetric/tet_cut1.py
examples/volumetric/tet_cut2.py
examples/other/flag_labels1.py
2023.4.6
2023.4.5
Main changes
- Rename module
io.py
tofile_io.py
to avoid overriding stlibio
. - Complete revision of cutter widgets functionality
- Integration in napari thanks to @jo-mueller
Breaking changes
- method
plotter.add()
no more accepts keywordrender=True/False
. Please useplotter.add().render()
explicitly. Same thing forplotter.remove()
.
Other fixes and improvements
- added gpu acceleration for CLI volumetric visualization in #832 by @zhang-qiang-github
- fixes for
k3d
jupyter backend - added
plotter.fov(value)
(field of view, the so called "fish-eye" effect) - fix
ploter.get_meshes()
- fix for
plotter.remove(unpack_assemblies=False)
method - fix for
io.import_window()
method - added
cut_with_cookiecutter()
to cut 2D contours. - fix
shapes.NormalLines()
class - added
vedo.interactor_modes
module - added
vedo.interactor_modes.BlenderStyle
class - added
base.pointdata.clear()
to remove all associated data - added
volume.hide_voxels()
for visualization - added
Event.timerid
attribute - fix to
Volume.operation
by @DanKrsi - fix links in
pyplot
examples by @androbaza - fix
screenshot_scale
and remove it from settings. - allow initializing
ScalarBar
with a tuple range(min, max)
- Update API Documentation for Changing Backend by @bhacha
- Add
application.Browser().play()
to autoplay a slider - Add
pad()
to padding a Volume with zeros voxels (useful todilate()
) - Add
ProgressBarWidget()
to show a progress bar in the rendering window - Fix Scalarbar3D logscale and change separator symbol by @XushanLu
- Fix
vedo/interactor_modes.mouse_left_move()
by @MiticoDan - Added
applications.AnimationPlayer
class by @mikaeltulldahl - fix convex hull in 2D by @ManuGraiph
New/Revised Examples
examples/basic/sliders_range.py
examples/basic/interaction_modes.py
examples/advanced/timer_callback3.py
examples/advanced/warp6.py
examples/pyplot/histo_1d_e.py
examples/other/tensor_grid2.py
examples/simulations/airplane1.py
examples/simulations/lorenz.py
examples/simulations/gas.py
examples/simulations/aspring2_player.py
2023.4.4
Main changes
- New API docs
- added cli functionality with
vedo --search-code
to inspect the code for keywords - method
tomesh()
changed togenerate_mesh()
- fix for
mark_boundaries()
- use
vtkStaticCellLocator
instead ofvtkCellLocator
- improved
pointcloud.density()
function - add
utils.progressbar()
- add
trame
examples - add
utils.is_ragged()
to check if an array is homogeneuos (not ragged) - fix
shapes.Lines()
class - add
shapes.ThickTube()
as per #800 - add
settings.backend_autoclose
(default is True) to automatically closePlotter
after show() in jupyter notebooks, #802 - fix k3d backend - remove pinning to 2.7.4 #808
- in
Text2D
andText3D
shortcut to symbols are now formatted as:gamma
and no more as\gamma
- fix
mesh.stretch()
thanks to @mikaeltulldahl in #807 - fixes to
cmap()
- added
mesh.is_manifold()
method #813 - added
utils.open3d2vedo()
andutils.vedo2open3d
converters as per #663 - added
mesh.non_manifold_faces()
to detect and (try to) remove non-manifold faces of a triangular mesh #813 #663 and SlicerIGT/SlicerBoneReconstructionPlanner#35 - added
pointcloud.compute_acoplanarity()
method - add pipeline visualization with syntax
any_vedo_obj.pipeline.show()
or interactively by clicking an object and pressingy
. - fixes to
Button
class - in
map_points_to_cells()
added keywordmove
in #819 @19kdc3 - fix
flagpost()
by creating a new classaddons.Flagpost()
in #821 @ZiguoAtGitHub - add
vedo.io.Video(backend='imageio')
support for video generation - add
vedo.io.Video.split_frames()
of an already existing video file. - add
Picture2D
class - add
mesh.slice()
- added
__repr_html__
for all types (thanks to @haesleinhuepf input) - added
treelib
for pipeline representation - fixes to dolfin support
MeshActor
New/Revised Examples
examples/basic/mousehover0.py
examples/advanced/timer_callback0.py
examples/simulations/lorenz.py
examples/pyplot/embed_matplotlib.py
examples/other/trame_ex1.py
examples/other/trame_ex2.py
examples/other/trame_ex3.py
examples/other/make_video.py
examples/other/dolfin/ex06_elasticity4.py
examples/notebooks/test_types.ipynb
examples/notebooks/slider2d.ipynb
2023.4.3
Main changes
- Important fixes for
numpy 1.24
@jo-mueller (also relevant to brainglobe/brainrender#226 (comment) by @FedeClaudi @johnmbarrett ) - fixed interface to
pymeshlab==2022.2.post2
- fixed #774
intersect_with_line()
- fixed exporting to x3d for assemblies
- added support to calarbars into assemblies, thanks to @j042 in #779
- fix typos #780
settings.allow_interaction
is now (temporarily) disabled.- added example
basic/shadow3.py
(thanks to @paul0noah in #767) - fix on OSX window focusing
- various fixes for windows OS
- add VTK_HEXAHEDRON to vedo.vtkclasses by @j042 in #762
- minor typo fix by @j042 in #780
- Keep scalarbar(s) in Assembly by @j042 in #779
New Contributors
New/Revised examples
examples/basic/shadow3.py
examples/other/pymeshlab1.py
examples/other/pymeshlab2.py
Full Changelog: v2022.4.2...v2023.4.3
2022.4.2
Main changes
base.py
- added
basegrid.extract_cells_on_plane()
- added
basegrid.extract_cells_on_sphere()
- 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
- added
cut_with_planes()
to cut at once with multiple planes - added
generate_random_data()
for testing purposes - renamed
vignette()
toflagpole()
- added new
flagpost()
similar to the above - added new property
pointcloud.cellcolors
andpointcolors
to access and modify colors by RGBA assignment. - added
compute_camera_distance()
to calculate the distance from points to the camera.
A pointdata array is created with name 'DistanceToCamera'. - added
cut_with_scalars()
to cut polygonal data with some input scalar data.
mesh.py
- improved
binarize()
method thanks to @vfmatzkin - added
collide_with()
to fix crashing ofintersect_with()
in special cases - added
check_validity()
- added
method=4
forsubdivide()
- added
intersect_with_plane()
- added
boolean(..., method=1)
- added
intersect_with_multiplanes()
to generate a set of lines from cutting a mesh in n intervals
between a minimum and maximum distance from a plane of given origin and normal.
plotter.py
- fixed key bindings for uppercase hits.
- added method
add_hint()
to generate a pop-up message on hovering an object - fix output of template camera when pressing "C"
- improved
move_camera()
- added key-press
R
to reset camera viewup to closest orthogonal viewup
added corresponding methodplotter.reset_viewup()
- added press
.
to fly to last clicked point and zoom in
picture.py
- generate false colors for an image with
Picture().cmap()
pyplot.py
- clicking on a histogram shows the bin value
- add
as2d()
method to freeze a plot in 2d canvas, without mouse interaction (experimental)
shapes.py
- Added support for chinese and japanese chars
- Added font "ComicMono"
- added possibility to create a disc sector in
Disc(angle_range=...)
tetmesh.py
- added
compute_tets_volume()
- added
check_validity()
volume.py
- added
vtkFlyingEdges3D
instead of contouring, which is faster.
Examples
New/Revised
examples/basic/color_mesh_cells1.py
examples/basic/color_mesh_cells2.py
examples/pyplot/fit_curve.py
examples/pyplot/histo_2d_a.py
examples/pyplot/histo_2d_b.py
examples/other/flag_labels2.py
examples/volumetric/image_false_colors.py
2022.4.1
This version includes various fixes, but the most important thing is that it implements the snake_case
naming scheme (instead of camelCase
) for all class methods and functions, so e.g. code like this
(in vedo==2022.3.1):
mesh = Mesh("bunny.obj")
mesh.cutWithPlane()
now becomes (in vedo==2022.4.1):
mesh = Mesh("bunny.obj")
mesh.cut_with_plane() ##### <----
Check out the docs in case of doubts.
See discussion #705
@jkissi @zhang-qiang-github @XushanLu @Gjacquenot @FedeClaudi @ManuGraiph @infinity77 @lukablagoje @LogWell @Amin-Fakia @nantille
addons.py
- improved slider callback interface
mesh.py
- fixed issue #593
volume.py
- can warp scalars in a volumetric dataset with
warp()
New/Revised Examples
examples/pyplot/fill_gap.py
examples/basic/sliders_hsv.py
examples/volumetric/slicer2.py
examples/volumetric/warp_scalars.py
examples/other/qt_window3.py
2022.3.0
Main changes
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!
applications.py
- added
SplinePlotter
object
pointcloud.py
- bug fix in
clone()
- added
labels2D()
- added logscale for colormapping in method
cmap(..., logscale=True)
- added explicit label formatting for scalarbars, @XushanLu
plotter.py
- added
breakInteraction()
to break window interaction and return to the python execution flow
picture.py
- added class
MatplotlibPicture
to embed matplotlib figures as 2d objects in the scene.
shapes.py
- Added
text()
method to update 3d text on the fly, by @mkerrin - Added
pcaEllipse()
analogous topcaEllipsoid()
for 2D problems.
utils.py
- added
getUV()
method to get the texture coordinates of a 3D point
volume.py
Volume(np_array)
does not need array to be transposed anymore. Warning: this may cause flipping of the x-z axes!- added
slicePlane(autocrop=False)
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