Skip to content

Commit fbb652e

Browse files
author
anna-charlotte
committed
docs: update docstring
Signed-off-by: anna-charlotte <[email protected]>
1 parent d5abac9 commit fbb652e

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

docarray/typing/url/url_3d/mesh_url.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class MyDoc(BaseDocument):
4545
assert isinstance(tensors.vertices, NdArray)
4646
assert isinstance(tensors.faces, NdArray)
4747
48+
4849
:return: VerticesAndFaces object containing vertices and faces information.
4950
"""
5051
from docarray.documents.mesh.vertices_and_faces import VerticesAndFaces
@@ -59,6 +60,7 @@ class MyDoc(BaseDocument):
5960
def display(self) -> None:
6061
"""
6162
Plot mesh from url.
63+
This loads the Trimesh instance of the 3D mesh, and then displays it.
6264
"""
6365
from IPython.display import display
6466

docarray/typing/url/url_3d/point_cloud_url.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def load(
3838
3939
4040
class MyDoc(BaseDocument):
41-
point_cloud_url: PointCloud3DvUrl
41+
point_cloud_url: PointCloud3DUrl
4242
4343
4444
doc = MyDoc(point_cloud_url="toydata/tetrahedron.obj")
@@ -74,6 +74,24 @@ class MyDoc(BaseDocument):
7474
def display(self, samples: int = 10000) -> None:
7575
"""
7676
Plot point cloud from url.
77+
First, it loads the point cloud into a :class:`PointsAndColors` object, and then
78+
calls display on it. The following is therefore equivalent:
79+
80+
.. code-block:: python
81+
82+
import numpy as np
83+
from docarray import BaseDocument
84+
85+
from docarray.documents import PointCloud3D
86+
87+
pc = PointCloud3D("toydata/tetrahedron.obj")
88+
89+
# option 1
90+
pc.url.display()
91+
92+
# option 2 (equivalent)
93+
pc.url.load().display()
94+
7795
:param samples: number of points to sample from the mesh.
7896
"""
7997
self.load(samples=samples).display()

0 commit comments

Comments
 (0)