Skip to content

Commit 466f613

Browse files
committed
docstrings and typing
1 parent 2a76e34 commit 466f613

File tree

8 files changed

+158
-54
lines changed

8 files changed

+158
-54
lines changed

src/compas_cgal/booleans.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ def _boolean(A, B, operation):
88
99
Parameters
1010
----------
11-
A : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
11+
A : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
1212
Mesh A.
13-
B : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
13+
B : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
1414
Mesh B.
1515
operation : Literal['union', 'difference', 'intersection']
1616
The type of boolean operation.
1717
1818
Returns
1919
-------
20-
(V, 3) np.array[float]
20+
NDArray[(Any, 3) np.float64]
2121
The vertices of the boolean mesh.
22-
(F, 3) np.array[int]
22+
NDArray[(Any, 3) np.int32]
2323
The faces of the boolean mesh.
2424
2525
Raises
@@ -53,18 +53,18 @@ def boolean_union(A, B):
5353
5454
Parameters
5555
----------
56-
A : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
56+
A : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
5757
Mesh A.
58-
B : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
58+
B : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
5959
Mesh B.
6060
operation : Literal['union', 'difference', 'intersection']
6161
The type of boolean operation.
6262
6363
Returns
6464
-------
65-
(V, 3) np.array[float]
65+
NDArray[(Any, 3) np.float64]
6666
The vertices of the boolean mesh.
67-
(F, 3) np.array[int]
67+
NDArray[(Any, 3) np.int32]
6868
The faces of the boolean mesh.
6969
7070
"""
@@ -77,18 +77,18 @@ def boolean_difference(A, B):
7777
7878
Parameters
7979
----------
80-
A : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
80+
A : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
8181
Mesh A.
82-
B : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
82+
B : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
8383
Mesh B.
8484
operation : Literal['union', 'difference', 'intersection']
8585
The type of boolean operation.
8686
8787
Returns
8888
-------
89-
(V, 3) np.array[float]
89+
NDArray[(Any, 3) np.float64]
9090
The vertices of the boolean mesh.
91-
(F, 3) np.array[int]
91+
NDArray[(Any, 3) np.int32]
9292
The faces of the boolean mesh.
9393
9494
"""
@@ -101,18 +101,18 @@ def boolean_intersection(A, B):
101101
102102
Parameters
103103
----------
104-
A : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
104+
A : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
105105
Mesh A.
106-
B : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
106+
B : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
107107
Mesh B.
108108
operation : Literal['union', 'difference', 'intersection']
109109
The type of boolean operation.
110110
111111
Returns
112112
-------
113-
(V, 3) np.array[float]
113+
NDArray[(Any, 3) np.float64]
114114
The vertices of the boolean mesh.
115-
(F, 3) np.array[int]
115+
NDArray[(Any, 3) np.int32]
116116
The faces of the boolean mesh.
117117
118118
"""

src/compas_cgal/intersections.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ def intersection_mesh_mesh(A, B):
99
1010
Parameters
1111
----------
12-
A : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
12+
A : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
1313
Mesh A.
14-
B : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
14+
B : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
1515
Mesh B.
1616
1717
Returns
1818
-------
19-
list[np.array[np.array[float]]]
19+
list[NDArray[(Any, 3), np.float64]]
2020
A list of intersection polylines, with each polyline an array of points.
2121
2222
"""

src/compas_cgal/measure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def volume(mesh):
99
1010
Parameters
1111
----------
12-
mesh : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
12+
mesh : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
1313
The mesh.
1414
1515
Returns

src/compas_cgal/meshing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def remesh(mesh, target_edge_length, number_of_iterations=10, do_project=True):
99
1010
Parameters
1111
----------
12-
mesh : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
12+
mesh : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
1313
The mesh to remesh.
1414
target_edge_length : float
1515
The target edge length.
@@ -20,9 +20,9 @@ def remesh(mesh, target_edge_length, number_of_iterations=10, do_project=True):
2020
2121
Returns
2222
-------
23-
(V, 3) np.array[float]
23+
NDArray[(Any, 3), np.float64]
2424
The vertices of the remeshed mesh.
25-
(F, 3) np.array[int]
25+
NDArray[(Any, 3), np.int32]
2626
The faces of the remeshed mesh.
2727
2828
Notes

src/compas_cgal/slicer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ def slice_mesh(mesh, planes):
99
1010
Parameters
1111
----------
12-
mesh : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
12+
mesh : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
1313
The mesh to slice.
1414
planes : list[[point, normal] | :class:`compas.geometry.Plane`]
1515
The slicing planes.
1616
1717
Returns
1818
-------
19-
list[np.array[np.array[float]]]
19+
list[NDArray[(Any, 3), np.float64]]
2020
A list of slice polylines, with each polyline an array of points.
2121
2222
"""

src/compas_cgal/subdivision.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ def catmull_clark(mesh, k=1):
77
88
Parameters
99
----------
10-
mesh : tuple[sequence[[float, float, float] | :class:`compas.geometry.Point`], sequence[[int, int, int]]]
10+
mesh : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
1111
The mesh to remesh.
1212
k : int, optional
1313
The number of subdivision steps.
1414
1515
Returns
1616
-------
17-
(V, 3) np.array[float]
17+
NDArray[(Any, 3) np.float64]
1818
The vertices of the subdivided mesh.
19-
(F, 4) np.array[int]
19+
NDArray[(Any, 4) np.int32]
2020
The faces of the subdivided mesh.
2121
2222
"""

src/compas_cgal/triangulation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ def refined_delaunay_mesh(boundary, points=None, holes=None, curves=None, maxlen
130130
131131
Returns
132132
-------
133-
(V, 3) np.array[float]
133+
NDArray[(Any, 3), np.float64]
134134
The vertices of the triangulation.
135-
(F, 3) np.array[int]
135+
NDArray[(Any, 3), np.int32]
136136
The faces of the triangulation.
137137
138138
References

0 commit comments

Comments
 (0)