feat(v2): display mesh and pointcloud#1113
Conversation
317d3f7 to
d2ed66a
Compare
|
Problem with poetry: Because scipy (1.10.0) requires Python <3.12,>=3.8I guess therefore for now one needs to install |
2ad2c4f to
c8e8c90
Compare
|
After talking to @samsja we think that it would be nice to not have the class VerticesAndFaces(BaseDocument):
vertices: AnyTensor
faces: AnyTensor
def display():
"""display mesh from tensors"""@JohannesMessner do you have any thought on this? |
fully agree with putting it at the type level. I am not 100% convinced with having "magic" documents such as |
| return Mesh3DLoadResult(vertices=vertices, faces=faces) | ||
| return VerticesAndFaces(vertices=vertices, faces=faces) | ||
|
|
||
| def display(self) -> None: |
There was a problem hiding this comment.
url.display feels a bit weird to me, because in this case it doesn't really display the url, it displays the thing the url points to.
And to do that, it has to load from that url under the hood.
So is it necessary to expose this? Why not url.load().display()?
There was a problem hiding this comment.
yeah i see your point, but its not quite the same, when displaying it from url as it is now, we can display it with color because we just call .show() on the trimesh instance. For url.load().display() we extract the vertices and faces information but as of right now there is no way to extract the color information. Therefore this displays without colors. I think it would be nice to keep the color display if url content includes this information.
What do you think?
There was a problem hiding this comment.
but this is true that it is weird to display some data (the color) that we cannot load in our tools
There was a problem hiding this comment.
yes true, can be a bit misleading or confusing, too. do u suggest to remove it then for the url, and do the url.load().display() if someone doesn't want to load it into the tensors? I think this won't change on trimesh side any time soon, to easily extract color information.
There was a problem hiding this comment.
so what's the conclusion here? keep it as it is? I see the point of being able to show colors, so I don't have a strong opinion anymore
There was a problem hiding this comment.
I would keep it like this, for the colors and also to have the display method for all urls
e0e8d1a to
fbb652e
Compare
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
1dba1db to
38f771d
Compare
Signed-off-by: anna-charlotte <[email protected]>
| Plot mesh in notebook from url. | ||
| This loads the Trimesh instance of the 3D mesh, and then displays it. | ||
| """ | ||
| from IPython.display import display |
There was a problem hiding this comment.
what ahppened if we are not inside IPython ?
There was a problem hiding this comment.
I think for mesh and point cloud it would still open a pyglet window and display it, but for the other IPython displays it would just print something like '< IPython.display.Audio obj >'.
Signed-off-by: anna-charlotte <[email protected]>
Signed-off-by: anna-charlotte <[email protected]>
|
📝 Docs are deployed on https://ft-feat-display-mesh-v2--jina-docs.netlify.app 🎉 |
Goals:
Add display methods to
PointCloud 3DandMesh3Durls and the corresponding tensors. For the tensors, first add classes to store those in:VerticesAndFacesfor mesh (to store vertices: AnyTensor, faces: AnyTensor),PointAndColorsfor point cloud (to store points: AnyTensor, colors: AnyTensor).For
PointCloud3Dyou can call.display()on its url or tensors:For
Mesh3Dyou can call.display()on its url or tensors: