boolean_difference
- compas_cgal.booleans.boolean_difference(A, B)[source]
Boolean difference 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_difference
>>> 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_difference(A, B) >>> shape = Polyhedron(*C)