Is there any way to orient 2D glyphs in mayavi points3d? - python

I am adding some cross markers to my plot using:
points = mlab.points3d(*vertices.T, mode='2dcross')
But the orientation of the 2D crosses is fixed. Ideally I want the crosses to face the camera. I have seen this Python3.0 Mayavi rotating cube glyph which shows how you can rotate 3D cube glyphs, but this doesn't make any difference for the 2D glyphs.
Any suggestions?

Related

How to create a 3d plane surface from 4 points?

I have the coordinates of four 3D points bounding a 3d plane representing a wall. I want to create a 3D object of that plane using python. Red points shown in figure are the boundaries of the plane, while green points are boundaries of voids in the plane. Any help by a simple code or name of a library or a method?
PS: The shown figure is a mesh but I want a planar surface something like that

How to set camera angle of a 2D plot in matplotlib?

I have generated a series of 2D plots using matplotlib.pyplot. I want to change the perspective of each 2D plot to make them look more "3D" (from the rectangular shape to parallelogram shape) and stack them together by hand, which will look something like this:
If there are texts present in the 2D plot (e.g. labels, title, legend), I want them to be rotated together with the plot. The reason I don't want to use mplot3d is that it doesn't support some advanced functions that is used in my 2D plots.
This has already been asked before for 3D plots: how to set "camera position" for 3d plots using python/matplotlib?, but the ax.view_init is only implemented for 3D plots. I wonder if there is a way to also change the camera angle for a 2D plot. If not, are there any tools that can do this task?

Replotting result of find_contours onto a different grid

I have used the skimage find_contours on some velocity data but I am struggling to work out how to replot the contour outline onto a longitude latitude grid ?
I think it is some sort of transform in coordinates but I am struggling to work out how.

generate an arbitrary angled contour from 3D data points

I am wondering if there is a way to generate 2d contour plots from a set of 3D data points using either python or matlab? The 3D data points create a roughly spherical shape and the contour would represent the outer border of this spheroid on different planes angled from 0 to 180 degrees
I am thinking one way is to generate a 3D surface from the pointcloud by using numpy.meshgrid and then using plot_surface. However, I also do not find a way to take angled slices out of the interpolated 3D data to obtain a contour.
Ideas very welcome!
thanks
Jesse

Perform spherical projection of image in python

I am writing a program using PyGTK that displays a gtk.Image. The desktop is projected onto the inside of a spherical dome. If the image displayed is rectangular on the screen, once projected onto a sphere it gets distorted.
To help picture this: The desktop itself is square. The center pixel of the desktop projects to the zenith and a circle inscribed inside the square desktop becomes the horizon (0 degrees elevation in polar coordinates). Everything outside that (in the corners of the desktop) is not displayed.
I would like to somehow modify the gtk.Image such that it still appears rectangular on the spherical surface. I'm sure there are lots of details in how this projection could be done, but very simplistically I have to convert the rectangular image into a curved trapezoid. Converting to a range of polar coordinates (e.g., map this rectangle to the area between two azimuth and two elevation angles) would be a good first approximation, though you can imagine if the elevation angles are 0 and 90, the resulting image will be a wedge of the sphere and not look rectangular at all.
How can I apply transformations like this to a gtk.Image (or its underlying Pixbuf)? Is there a package already that can do this? If not, how should I go about writing it from scratch? Presumably I would have to pull out the pixel values, map them to some new grid, and replace the original image. I just don't want to reinvent something that has already been done.

Categories

Resources