1212from .meshing import trimesh_remesh_along_isoline , trimesh_remesh_along_isolines
1313
1414
15- __author__ = "See AUTHORS.md for more information about COMPAS libigl authors."
16- __copyright__ = "Block Research Group - ETH Zurich"
17- __license__ = "Mozilla Public License Version 2.0"
18- 1915__version__ = "0.4.0"
2016
2117
@@ -34,14 +30,8 @@ def get(filename):
3430 ----------
3531 filename : str
3632 The name of the data file.
37- The following are available.
38-
39- * boxes.obj
40- * faces.obj
41- * fink.obj
42- * hypar.obj
43- * lines.obj
44- * saddle.obj
33+ The filename should be specified relative to the COMPAS data directory,
34+ without leading or trailing slashes.
4535
4636 Returns
4737 -------
@@ -50,17 +40,14 @@ def get(filename):
5040
5141 Notes
5242 -----
53- The file name should be specified relative to the sample data folder.
54- This folder is only locally available if you installed :mod:`compas_libigl` from source,
55- or if you are working directly with the source.
56- In all other cases, the function will get the corresponding files direcly from
57- the GitHub repo.
43+ The file name should be specified relative to the package data directory
44+ (``compas_libigl/data``).
5845
5946 Examples
6047 --------
61- >>> import compas_libigl as igl
62- >>> from compas.datastructures import Mesh
63- >>> mesh = Mesh.from_off(igl. get("bunny.off") )
48+ >>> import os
49+ >>> from compas_libigl import get
50+ >>> get('tubemesh.json' )
6451
6552 """
6653 filename = filename .strip ("/" )
@@ -69,20 +56,21 @@ def get(filename):
6956
7057 if os .path .exists (localpath ):
7158 return localpath
72- else :
73- return "https://github.com/BlockResearchGroup/compas_libigl/raw/master/data/{}" .format (filename )
7459
60+ return None
7561
76- def get_beetle ():
77- return "https://raw.githubusercontent.com/libigl/libigl-tutorial-data/master/beetle.off"
7862
63+ def find (name ):
64+ """Find a file in the data directory through recursive search.
7965
80- def get_armadillo ():
81- return "https://raw.githubusercontent.com/libigl/libigl-tutorial-data/master/armadillo.obj"
66+ """
67+ datapath = DATA
68+ return compas .find (name , datapath )
8269
8370
8471__all_plugins__ = [
85- "compas_libigl._nanobindcompas_libigl._boundaries" ,
72+ "compas_libigl._nanobind" ,
73+ "compas_libigl.boundaries" ,
8674 "compas_libigl.curvature" ,
8775 "compas_libigl.geodistance" ,
8876 "compas_libigl.intersections" ,
@@ -101,8 +89,7 @@ def get_armadillo():
10189 "add" ,
10290 "__doc__" ,
10391 "get" ,
104- "get_beetle" ,
105- "get_armadillo" ,
92+ "find" ,
10693 "trimesh_boundaries" ,
10794 "trimesh_gaussian_curvature" ,
10895 "trimesh_principal_curvature" ,
0 commit comments