boolean_union
- compas_cgal.booleans.boolean_union(A, B)[source]
Boolean union of two meshes.
- Parameters
- Returns
NDArray[(Any, 3), np.float64] – The vertices of the boolean mesh.
NDArray[(Any, 3), np.int32] – The faces of the boolean mesh.
Examples
>>> from compas.geometry import Box, Sphere, Polyhedron >>> from compas_cgal.booleans import boolean_union
>>> box = Box.from_width_height_depth(1, 1, 1) >>> sphere = Sphere([1, 1, 1], 0.5)
>>> A = box.to_vertices_and_faces(triangulated=True) >>> B = sphere.to_vertices_and_faces(u=32, v=32, triangulated=True)
>>> C = boolean_union(A, B) >>> shape = Polyhedron(*C)