Open aluthfian opened 1 month ago
Hi @aluthfian! I developed some code for doing this a couple of years back, which also uses the vtk model object. The last time I tried running this plotting code though I remember having problems loading the vtk model into pyvista. I haven't dug into this to try and sort it out. I'll try to revive my code and clean it up enough to share.
It would be very interesting to experiment with both of our plotting codes and combine the best of both. I seem to remember my approach being a little more complicated and requiring many more lines of code so your approach maybe cleaner. I know that in mine I opted to plot depth versus the along profile distance instead of x or y coordinates.
I have definitely found the ability to plot arbitrarily oriented sections to be valuable. Here is an example plot from a recent paper.
@micmitch Good idea! In my earlier version of this, I used vtk's slice along line capability and then retrieve the points on the slice using ctp(). This was very slow (needs tens of seconds to run), memory intensive, and results in a longer code. The approach I proposed here is faster to run (a few seconds only) and keep the voxel-like shape intact for honesty and transparency (although interpolation option may be possible to implement so the plot can look "smooth").
Changing the x axis into distance instead of Northing/Easting should also be given as an option as well, like:
np.linalg.norm
I am interested on how you produced your smooth plot since I can only to use scipy.interpolation.griddata(..."linear"...)
for my case (other interpolation methods were just failed).
(Sorry for the closing and reopening of the same issue, commenting on GitHub mobile and small screen is not that convenient!)
Hi all, I just want to propose a feature addition (if there isn't any) for future releases of discretize: slicing the mesh using a straight line of arbitrary direction. I propose this feature as an addition to the already available
discretize.TensorMesh.plot_slice
. The draft code for this functionality is given below.The final result will look like this:![image](https://github.com/simpeg/discretize/assets/47322232/2c7111c2-a109-495f-86a8-16f8ae9237ef)
Thanks for reading!