Skip to content

3D deformation grids visualisation. #450

Answered by marcomusy
antonfrancois asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Anton,
Thanks for your nice words! You can create a Mesh by defining vertices and faces with Mesh([pts,faces]). There are classes that simplify this for simple objects ike "Grid". E.g.:

from vedo import *
import numpy as np

xcoords = np.arange(0, 2, 0.2)
ycoords = np.arange(0, 1, 0.2)
sqrtx = sqrt(xcoords) # to make them non-uniform

grid1 = Grid(sx=sqrtx, sy=ycoords).lineWidth(3)
print(grid1.points())
grid2 = Grid(sx=sqrtx, sy=ycoords).lineWidth(3)
grid2.rotateY(15).shift(0,0.5,0.8)

arrows = Arrows(grid1, grid2, s=0.3).lighting('off')

grid = merge(grid1, grid2) # optionally fuse them into a single object

plt = show(grid, arrows, axes=1)  # returns a Plotter object

For deformation…

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@antonfrancois
Comment options

Answer selected by antonfrancois
Comment options

You must be logged in to vote
1 reply
@antonfrancois
Comment options

Comment options

You must be logged in to vote
1 reply
@antonfrancois
Comment options

Comment options

You must be logged in to vote
1 reply
@marcomusy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants