vedo
vedo copied to clipboard
Generating a point cloud of cylindrical geometry
Hello @marcomusy,
I've a cylindrical object created using the Cylinder class. I want to define the cylindrical geometry generated from vedo as a PointCloud in Deepxde for simulations.
from vedo import *
from vedo import plotter as vplt
cyl = Cylinder(r=1, height=10, cap=True, alpha=0.8, c='grey').pos([5, 0])
vplt.show(cyl)
Could you please suggest how to obtain pointcould?
Also, could you please let me know if we can generate pointcloud for the internal volume (currently this appears as void space in the visualization i.e. hollow cylinder)?
Hi,
You can use cyl.points() and - if needed - cyl.faces() - to have a numpy array of the coordinates.
Hi,
I tried
cyl = Cylinder(r=1, height=10, cap=True, alpha=0.8, c='grey').pos([5, 0])
pts = Points(cyl.points(), c='k')
plt.show(pts)
To check if I could get the coordinates of all the points on the cylinder boundaries/faces.
Unfortunately, I see only a few points on the cap. Could you please have a look? I'm not sure if I am doing it the right way.
Also,
cyl.faces() returns the polygon cell connectivity. I am not sure how to get the coordinates.
The coordinates are given by cyl.points() you don't need faces most likely..
Maybe a better way to get the cylinder in your case is by extruding a circle:
from vedo import Circle, Points, show
disc = Circle(r=1, res=25).linewidth(1)
cyl = disc.extrude(3, res=50)
pts = Points(cyl, c='red5')
show(cyl, pts, axes=1)
Thank you so much. Actually, I also need the faces to specify the boundary conditions on the faces.