New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Obtaining boundary points #1061
Comments
Hi @DeepaMahm long time no see :) After:
Try this: from vedo import *
pts = Points("fig_4b_collacation_points.txt")
msh = pts.generate_delaunay2d(mode='xy', alpha=0.0035)
msh.keep_cell_types(["triangle"]) # to remove lines
print(msh)
bmsh = msh.boundaries()
lines = [b.lw(3) for b in bmsh.split()]
show([pts, lines], N=2) (note that the lines are a bit rounded at intersections.. but this is kind of difficult to achieve without generating holes .. not sure if vedo is the best tool to use in this case!) Or this completely different approach: from vedo import *
img = Image("https://github.com/DeepaMahm/misc/blob/master/Bagah.jpeg")
msh = img.bw().tomesh().threshold("RGBA", above=10)
qmsh = msh.boundaries().c("red5").lw(2)
show([img, [msh, qmsh]], N=2, axes=1) |
Hello @marcomusy , bmsh = msh.boundaries() gives the bounding lines. Can we get the points formed by these lines? Alternately, I tried,
Unfortunately, this is not working for me. |
Sorry I don't understand the question. The lines are made of points, which you can read as eg:
|
Hi @marcomusy I managed to get the boundaries using a software. The corresponding point cloud is uploaded here for your kind reference (data) I would like to know if it is possible to load these boundary points in vedo and create a bmsh object. I would like to detect the edges and split/partition the edges for calculating the slope and intercept of the lines forming the edges.
|
Difficult problem as you do not have a concept of "inside" and "outside" .. maybe this can help: from vedo import *
pts = Points("data/points_edges.txt")
x0, x1, y0,y1, z0,z1 = pts.bounds()
z0,z1 = -0.1, 0.1
msh = pts.reconstruct_surface(dims=(200,200,40), radius=0.004, bounds=(x0,x1,y0,y1,z0,z1))
msh.lighting('off')
msh.mark_boundaries().cmap("viridis_r", "BoundaryPoints")
show(pts, msh, N=2, axes=1) |
Hi @marcomusy ,
For a geometry like the following
I would like to get all the boundaries (please refer to the lines marked with black and indicated with arrows).
Using,
I could obtain the points marked with red dots as boundaries.
Could you please help me with obtaining all the boundary points (i.e. including boundaries inside the domain)?
The original geometry is added here (image) for your kind reference and I would like to get the boundary points of all the vessel branches. The pointcloud of the geometry is included here (pointcloud), kindly see.
The text was updated successfully, but these errors were encountered: