Search code examples
pythonmatplotlib3dmeshprojection

Python : How to project a 3D unstructured mesh to 2D?


From an unstructured mesh (X,Y,Z + connectivity), I wish to create a 2D array corresponding to Z projection (top-view) on plane(X,Y). At this end, I have used plot_trisurf from matplotlib (for 3D representation .. and it works) and then I have tried to use contourf(X, Y, Z, zdir='z') to realize the projection. Unfortunately this last function seems to be only dedicated for structured mesh.

Is there a way to obtain (easily, with existing libraries) what I am looking for?


Solution

  • You can use tricontour. You can find some examples in the documentation. This is an example that they present there:

    enter image description here