Code Monkey home page Code Monkey logo

Comments (5)

maartenbreddels avatar maartenbreddels commented on May 16, 2024 2

Thanks, I'll keep this open and dive into it later, maybe it is possible more efficiently.

from ipyvolume.

maartenbreddels avatar maartenbreddels commented on May 16, 2024

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).
A workaround is thus to duplicate the vertices:

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.
I've also updated the documentation for this. Let me know if this solves it.

cheers,

Maarten

from ipyvolume.

deeplycloudy avatar deeplycloudy commented on May 16, 2024

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,
Eric

from ipyvolume.

deeplycloudy avatar deeplycloudy commented on May 16, 2024

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.

from ipyvolume.

maartenbreddels avatar maartenbreddels commented on May 16, 2024

I think this can be done at the kernel side first, I guess face_colors and triangle_colors arguments to plot_* would need to sort out the duplication of vertices manually.

from ipyvolume.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.