I have the following code to create a cone for which a displacement field will be applied later on. In the figure shown below you can see that some big triangles are drawn a
You have probably moved on or solved this yourself by now, but I thought I'd throw an answer up for future vistors.
The reason you are getting triangles in the smaller circle is not a max-distance thing, it is because those triangles are contained within the convex hull of your points projection on the x,y plane.
If you look at the plot_trisurf
source, (numpy.source(Axes3D.plot_trisurf)
) you'll see that it performs delaunay triangulation every time and there is no opportunity to define your triangles or exclude unwanted triangles.
Two options:
copy the source of plot_trisurf to your script and add the line tri.set_mask(...) (tri is a matplotlib.tri.triangulation.Triangulation
instance) using the algo of your choice (some max edge length criteria or find triangles who centroids are within some radius.. whatever suits your actual data) to create the boolean mask after triangulation is done.
define the triangles without using delaunay triangluation using Triangulation(x,y,triangles=...)
set plot_trisurf vmax
to be slightly below the plane of the circle.
*I didn't try either of these options