Skip to content Skip to sidebar Skip to footer

Annulus With Scipy Delaunay

i try to draw a 3d solid that represents an annulus. I have used the scipy module and Delaunay to do the calculation. Unfortunately the plot shows a 3d cylinder and not an annulus.

Solution 1:

As noted in the comments the convex hull is a convex shape and therefore cannot represent an annulus. However, the concept of the concave hull (also known as the alpha-shape) is probably appropriate for your needs. Basically, the alpha-shape removes from the Delaunay triangulation the triangles (tetrahedra in your 3D case) that have a circumradius greater than some value (defined by the alpha parameter).

This answer provides an implementation of the alpha-shape surface (i.e., the outer boundary) for 3D points. Using the alpha_shape_3D function from that answer, with an alpha value of 3, resulted in the figure below.

The following two lines in the code (replacing the assignment to CH and the plot function) do the job.

vertices, edges, facets = alpha_shape_3D(pos=M, alpha=3.)

ax.plot_trisurf(x,y,z,triangles=facets, shade=False, color='lightblue',lw=1, edgecolor='k')

enter image description here

Post a Comment for "Annulus With Scipy Delaunay"