Skip to content

Commit 1bdc33f

Browse files
DOCS docstrings in python source code.
1 parent 85c60a4 commit 1bdc33f

File tree

14 files changed

+45
-112
lines changed

14 files changed

+45
-112
lines changed

docs/acknowledgements.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Acknowledgements
33
********************************************************************************
44

55
This package provides Python bindings for selected methods of libigl developed by:
6+
67
* Tom van Mele, [email protected]
78
* Petras Vestartas, [email protected]
89

docs/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ def setup(app):
8383

8484
# linkcode
8585

86-
linkcode_resolve = sphinx_compas2_theme.get_linkcode_resolve(organization, package)
86+
import functools
87+
_linkcode_partial = sphinx_compas2_theme.get_linkcode_resolve(organization, package)
88+
89+
def linkcode_resolve(domain, info):
90+
return _linkcode_partial(domain, info)
8791

8892
# extlinks
8993

docs/examples/example_curvature_gaussian.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
viewer = Viewer()
5555

5656
# Add the colored mesh
57-
viewer.scene.add(trimesh, use_vertexcolors=True) # , vertexcolor=vertex_colors)
57+
viewer.scene.add(trimesh, use_vertexcolors=True, pointcolor=vertex_colors)
5858

5959
# Add normal vectors scaled by Gaussian curvature
6060
normal_scale = -10

docs/installation.rst

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,14 @@ Installation
55
Stable
66
======
77

8-
Stable releases of :mod:`compas_libigl` can be installed via ``conda-forge``.
9-
10-
.. code-block:: bash
11-
12-
conda create -n libigl -c conda-forge compas_libigl
13-
14-
or install in your python environment via pip:
8+
Stable releases of :mod:`compas_libigl` can be installed via pip:
159

1610
.. code-block:: bash
1711
1812
pip install compas_libigl
1913
20-
21-
Several examples use the COMPAS Viewer for visualisation.
22-
To install :mod:`compas_viewer` in the same environment
14+
For visualization (optional):
2315

2416
.. code-block:: bash
2517
26-
conda activate libigl
2718
pip install compas_viewer
28-
29-
30-
Dev Install
31-
===========
32-
33-
See :doc:`devguide`.

docs/tutorial.rst

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,6 @@
22
Tutorial
33
********************************************************************************
44

5-
.. rst-class:: lead
6-
7-
:mod:`compas_libigl` provides bindings for the libigl library.
8-
It doesn't cover the entire library, but provides bindings for specific geometry processing functions.
9-
The functions are organized into the following categories:
10-
11-
Mesh Analysis
12-
=============
13-
14-
Boundaries and Intersections
15-
----------------------------
16-
17-
* :func:`compas_libigl.trimesh_boundaries` - Compute boundary loops of a mesh
18-
* :func:`compas_libigl.intersection_ray_mesh` - Compute intersection of a ray with a mesh
19-
* :func:`compas_libigl.intersection_rays_mesh` - Compute intersections of multiple rays with a mesh
20-
21-
Curvature Analysis
22-
------------------
23-
24-
* :func:`compas_libigl.trimesh_gaussian_curvature` - Compute Gaussian curvature at vertices
25-
* :func:`compas_libigl.trimesh_principal_curvature` - Compute principal curvatures and directions
26-
27-
Geodesic Distances
28-
------------------
29-
30-
* :func:`compas_libigl.trimesh_geodistance` - Compute geodesic distance from a source vertex
31-
* :func:`compas_libigl.trimesh_geodistance_multiple` - Compute geodesic distances from multiple source vertices
32-
33-
Mass Properties
34-
---------------
35-
36-
* :func:`compas_libigl.trimesh_massmatrix` - Compute the mass matrix
37-
38-
Mesh Processing
39-
===============
40-
41-
Remeshing and Isolines
42-
----------------------
43-
44-
* :func:`compas_libigl.trimesh_isolines` - Extract isolines from a scalar field
45-
* :func:`compas_libigl.groupsort_isolines` - Sort and group isolines
46-
* :func:`compas_libigl.trimesh_remesh_along_isoline` - Remesh along a single isoline
47-
* :func:`compas_libigl.trimesh_remesh_along_isolines` - Remesh along multiple isolines
48-
49-
Parameterization
50-
----------------
51-
52-
* :func:`compas_libigl.trimesh_harmonic` - Compute harmonic parameterization
53-
* :func:`compas_libigl.trimesh_lscm` - Compute least squares conformal mapping
54-
55-
Mesh Optimization
56-
-----------------
57-
58-
* :func:`compas_libigl.quadmesh_planarize` - Planarize quad mesh faces
59-
60-
Utilities
61-
=========
62-
63-
* :func:`compas_libigl.get` - Get sample geometry files
64-
* :func:`compas_libigl.get_beetle` - Get the beetle mesh
65-
* :func:`compas_libigl.get_armadillo` - Get the armadillo mesh
665

676
Input/Output
687
============

src/compas_libigl/boundaries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def trimesh_boundaries(M):
1313
Parameters
1414
----------
1515
M : tuple[list[list[float]], list[list[int]]]
16-
A mesh represented by a list of vertices and a list of faces.
17-
The vertices should be 3D points, and faces should be triangles.
16+
A mesh represented by a tuple of (vertices, faces)
17+
where vertices are 3D points and faces are triangles
1818
1919
Returns
2020
-------

src/compas_libigl/curvature.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def trimesh_gaussian_curvature(M):
1212
Parameters
1313
----------
1414
M : tuple[list[list[float]], list[list[int]]]
15-
A mesh represented by a list of vertices and a list of faces.
16-
The vertices should be 3D points, and faces should be triangles.
15+
A mesh represented by a tuple of (vertices, faces)
16+
where vertices are 3D points and faces are triangles
1717
1818
Returns
1919
-------
@@ -37,8 +37,8 @@ def trimesh_principal_curvature(M):
3737
Parameters
3838
----------
3939
M : tuple[list[list[float]], list[list[int]]]
40-
A mesh represented by a list of vertices and a list of faces.
41-
The vertices should be 3D points, and faces should be triangles.
40+
A mesh represented by a tuple of (vertices, faces)
41+
where vertices are 3D points and faces are triangles
4242
4343
Returns
4444
-------

src/compas_libigl/geodistance.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ def trimesh_geodistance(M, source, method="exact"):
1313
1414
Parameters
1515
----------
16-
M : tuple[:class:`list`, :class:`list`]
17-
A mesh represented by a list of vertices and a list of faces.
18-
The vertices should be 3D points, and faces should be triangles.
16+
M : tuple[list[list[float]], list[list[int]]]
17+
A mesh represented by a tuple of (vertices, faces)
18+
where vertices are 3D points and faces are triangles
1919
source : int
2020
The index of the source vertex.
2121
method : str, optional
@@ -52,9 +52,9 @@ def trimesh_geodistance_multiple(M, sources, method="exact"):
5252
5353
Parameters
5454
----------
55-
M : tuple[:class:`list`, :class:`list`]
56-
A mesh represented by a list of vertices and a list of faces.
57-
The vertices should be 3D points, and faces should be triangles.
55+
M : tuple[list[list[float]], list[list[int]]]
56+
A mesh represented by a tuple of (vertices, faces)
57+
where vertices are 3D points and faces are triangles
5858
sources : list[int]
5959
The indices of the source vertices.
6060
method : str, optional

src/compas_libigl/intersections.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ def intersection_ray_mesh(ray, M):
1313
ray : tuple[list[float], list[float]]
1414
A ray represented by a point and a direction vector.
1515
M : tuple[list[list[float]], list[list[int]]]
16-
A mesh represented by a list of vertices and a list of faces.
16+
A mesh represented by a tuple of (vertices, faces)
17+
where vertices are 3D points and faces are triangles
1718
1819
Returns
1920
-------
@@ -43,7 +44,8 @@ def intersection_rays_mesh(rays, M):
4344
rays : list[tuple[list[float], list[float]]]
4445
List of rays, each represented by a point and a direction vector.
4546
M : tuple[list[list[float]], list[list[int]]]
46-
A mesh represented by a list of vertices and a list of faces.
47+
A mesh represented by a tuple of (vertices, faces)
48+
where vertices are 3D points and faces are triangles
4749
4850
Returns
4951
-------

src/compas_libigl/isolines.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ def trimesh_isolines(M, scalars, isovalues):
1212
1313
Parameters
1414
----------
15-
M : tuple[list[list[float]], list[list[int]]] | :class:`compas.datastructures.Mesh`
16-
A mesh represented by a list of vertices and a list of faces,
17-
or by a COMPAS mesh object.
15+
M : tuple[list[list[float]], list[list[int]]]
16+
A mesh represented by a tuple of (vertices, faces)
17+
where vertices are 3D points and faces are triangles
1818
scalars : list[float]
1919
A list of scalar values, one per vertex of the mesh.
2020
isovalues : list[float]
@@ -63,7 +63,7 @@ def groupsort_isolines(vertices, edges, indices):
6363
6464
Returns
6565
-------
66-
list[list[:class:`compas.geometry.Polyline`]]
66+
list[list[compas.geometry.Polyline]]
6767
A list of polyline groups, where each group corresponds to an isoline level.
6868
Each polyline represents a continuous segment of an isoline.
6969

0 commit comments

Comments
 (0)