@@ -8,9 +8,9 @@ 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.
@@ -53,9 +53,9 @@ 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.
@@ -67,6 +67,20 @@ def boolean_union(A, B):
6767 NDArray[(Any, 3), np.int32]
6868 The faces of the boolean mesh.
6969
70+ Examples
71+ --------
72+ >>> from compas.geometry import Box, Sphere, Polyhedron
73+ >>> from compas_cgal.booleans import boolean_union
74+
75+ >>> box = Box.from_width_height_depth(1, 1, 1)
76+ >>> sphere = Sphere([1, 1, 1], 0.5)
77+
78+ >>> A = box.to_vertices_and_faces(triangulated=True)
79+ >>> B = sphere.to_vertices_and_faces(u=32, v=32, triangulated=True)
80+
81+ >>> C = boolean_union(A, B)
82+ >>> shape = Polyhedron(*C)
83+
7084 """
7185 return _boolean (A , B , 'union' )
7286
@@ -77,9 +91,9 @@ def boolean_difference(A, B):
7791
7892 Parameters
7993 ----------
80- A : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
94+ A : tuple[Sequence[[float, float, float] | :class:`~ compas.geometry.Point`], Sequence[[int, int, int]]]
8195 Mesh A.
82- B : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
96+ B : tuple[Sequence[[float, float, float] | :class:`~ compas.geometry.Point`], Sequence[[int, int, int]]]
8397 Mesh B.
8498 operation : Literal['union', 'difference', 'intersection']
8599 The type of boolean operation.
@@ -91,6 +105,20 @@ def boolean_difference(A, B):
91105 NDArray[(Any, 3), np.int32]
92106 The faces of the boolean mesh.
93107
108+ Examples
109+ --------
110+ >>> from compas.geometry import Box, Sphere, Polyhedron
111+ >>> from compas_cgal.booleans import boolean_difference
112+
113+ >>> box = Box.from_width_height_depth(1, 1, 1)
114+ >>> sphere = Sphere([1, 1, 1], 0.5)
115+
116+ >>> A = box.to_vertices_and_faces(triangulated=True)
117+ >>> B = sphere.to_vertices_and_faces(u=32, v=32, triangulated=True)
118+
119+ >>> C = boolean_difference(A, B)
120+ >>> shape = Polyhedron(*C)
121+
94122 """
95123 return _boolean (A , B , 'difference' )
96124
@@ -101,9 +129,9 @@ def boolean_intersection(A, B):
101129
102130 Parameters
103131 ----------
104- A : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
132+ A : tuple[Sequence[[float, float, float] | :class:`~ compas.geometry.Point`], Sequence[[int, int, int]]]
105133 Mesh A.
106- B : tuple[Sequence[[float, float, float] | :class:`compas.geometry.Point`], Sequence[[int, int, int]]]
134+ B : tuple[Sequence[[float, float, float] | :class:`~ compas.geometry.Point`], Sequence[[int, int, int]]]
107135 Mesh B.
108136 operation : Literal['union', 'difference', 'intersection']
109137 The type of boolean operation.
@@ -115,5 +143,19 @@ def boolean_intersection(A, B):
115143 NDArray[(Any, 3), np.int32]
116144 The faces of the boolean mesh.
117145
146+ Examples
147+ --------
148+ >>> from compas.geometry import Box, Sphere, Polyhedron
149+ >>> from compas_cgal.booleans import boolean_intersection
150+
151+ >>> box = Box.from_width_height_depth(1, 1, 1)
152+ >>> sphere = Sphere([1, 1, 1], 0.5)
153+
154+ >>> A = box.to_vertices_and_faces(triangulated=True)
155+ >>> B = sphere.to_vertices_and_faces(u=32, v=32, triangulated=True)
156+
157+ >>> C = boolean_intersection(A, B)
158+ >>> shape = Polyhedron(*C)
159+
118160 """
119161 return _boolean (A , B , 'intersection' )
0 commit comments