Skip to content

Is there any way to get the Texture from a PngImageFile object? #145

@fishbotics

Description

@fishbotics

I'm trying to visualize a mesh that I loaded through Trimesh. It's easy to get the triangular mesh geometry (Meshcat just needs the vertices and faces) but I'm also trying to visualize the textures. For textured meshes, Trimesh uses an object called trimesh.visual.texture.TextureVisuals, which is instantiated with not the png file path but the PIL data as loaded from Pillow.

In Meshcat, the expectation is that I have the png file name, which was lost along the way when loading from Trimesh. Is there any other way to do this conversion?

I know this is kind of an esoteric question and seems sort of silly to be crossing back and forth between mesh libraries, but I find that it's helpful to be able to do mesh manipulation in Trimesh and then visualize complex things in Meshcat.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions