-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per-face colors in plot_trisurf #47
Comments
Hi Eric, I've modified the docs, it is only possible to specify per vertex properties, and these will be interpolated (at least that I know of, for WebGL). ipv.figure()
colors = np.ones((6,3))*.3
colors[:3, 2] = 1.0
colors[3:, 0] = 1.0
x = [0, 3., 3., 0, 0., 3.]
y = [0, 0., 4., 0, 4., 4.]
z = [1, 0., 1., 1, 0., 1.]
ipv.plot_trisurf(x, y, z,
triangles=[[0, 1, 2], [3, 5, 4]], color=colors)
ipv.show() Maybe it's an idea to have face_colors supported, that would do this automatically. cheers, Maarten |
Hi Maarten, Yes, the docs update will be helpful for others, and for now I can duplicate the vertices as you suggest. I'm doing some tests with fairly large meshes — O(10^6) vertices from a research weather radar — so there is some downside to duplicating, but I should still be ok. In the future, +1 for face_colors support! Thanks, |
Another thought: I was using the face_colors support in vispy in some earlier tests. Not sure if they also auto-duplicated vertices, or if they used some lower-level GL support for face colors. |
Thanks, I'll keep this open and dive into it later, maybe it is possible more efficiently. |
I think this can be done at the kernel side first, I guess |
The docs for
pylab.plot_trisurf
state thattriangles
is of shape (N,3) and thatcolor
should also be of shape (N, 3), implying that the colors will apply to the triangle faces, not the vertices.However, the observed behavior (on version 0.4.0a2 from PyPI) is to color the vertices.
If the above behavior is as intended? If so, is there another way to set the triangle face color directly?
The text was updated successfully, but these errors were encountered: