@@ -30,8 +30,14 @@ def get(filename):
3030 ----------
3131 filename : str
3232 The name of the data file.
33- The filename should be specified relative to the COMPAS data directory,
34- without leading or trailing slashes.
33+ The following are available.
34+
35+ * boxes.obj
36+ * faces.obj
37+ * fink.obj
38+ * hypar.obj
39+ * lines.obj
40+ * saddle.obj
3541
3642 Returns
3743 -------
@@ -40,14 +46,17 @@ def get(filename):
4046
4147 Notes
4248 -----
43- The file name should be specified relative to the package data directory
44- (``compas_libigl/data``).
49+ The file name should be specified relative to the sample data folder.
50+ This folder is only locally available if you installed :mod:`compas_libigl` from source,
51+ or if you are working directly with the source.
52+ In all other cases, the function will get the corresponding files direcly from
53+ the GitHub repo.
4554
4655 Examples
4756 --------
48- >>> import os
49- >>> from compas_libigl import get
50- >>> get('tubemesh.json' )
57+ >>> import compas_libigl as igl
58+ >>> from compas.datastructures import Mesh
59+ >>> mesh = Mesh.from_off(igl. get("bunny.off") )
5160
5261 """
5362 filename = filename .strip ("/" )
@@ -56,21 +65,20 @@ def get(filename):
5665
5766 if os .path .exists (localpath ):
5867 return localpath
68+ else :
69+ return "https://github.com/BlockResearchGroup/compas_libigl/raw/master/data/{}" .format (filename )
5970
60- return None
6171
72+ def get_beetle ():
73+ return "https://raw.githubusercontent.com/libigl/libigl-tutorial-data/master/beetle.off"
6274
63- def find (name ):
64- """Find a file in the data directory through recursive search.
6575
66- """
67- datapath = DATA
68- return compas .find (name , datapath )
76+ def get_armadillo ():
77+ return "https://raw.githubusercontent.com/libigl/libigl-tutorial-data/master/armadillo.obj"
6978
7079
7180__all_plugins__ = [
72- "compas_libigl._nanobind" ,
73- "compas_libigl.boundaries" ,
81+ "compas_libigl._nanobindcompas_libigl._boundaries" ,
7482 "compas_libigl.curvature" ,
7583 "compas_libigl.geodistance" ,
7684 "compas_libigl.intersections" ,
@@ -89,7 +97,8 @@ def find(name):
8997 "add" ,
9098 "__doc__" ,
9199 "get" ,
92- "find" ,
100+ "get_beetle" ,
101+ "get_armadillo" ,
93102 "trimesh_boundaries" ,
94103 "trimesh_gaussian_curvature" ,
95104 "trimesh_principal_curvature" ,
@@ -105,4 +114,4 @@ def find(name):
105114 "quadmesh_planarize" ,
106115 "trimesh_remesh_along_isoline" ,
107116 "trimesh_remesh_along_isolines" ,
108- ]
117+ ]
0 commit comments