Skip to content

Commit

Permalink
basic boolean union code example
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed Sep 20, 2020
1 parent f19c366 commit cac1e86
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/compas/geometry/booleans/__init__.py
Expand Up @@ -26,6 +26,28 @@ def boolean_union_mesh_mesh(A, B):
-------
tuple
The vertices and the faces of the boolean union.
Examples
--------
>>> from compas.geometry import Box, Sphere
>>> from compas.geometry import boolean_union_mesh_mesh
>>> from compas.geometry import trimesh_remesh
>>> from compas.datastructures import Mesh
>>> box = Box.from_width_height_depth(2, 2, 2)
>>> box = Mesh.from_shape(box)
>>> box.quads_to_triangles()
>>> sphere = Sphere([1, 1, 1], 1)
>>> sphere = Mesh.from_shape(sphere, u=30, v=30)
>>> sphere.quads_to_triangles()
>>> A = box.to_vertices_and_faces()
>>> B = sphere.to_vertices_and_faces()
>>> B = trimesh_remesh(B, 0.3, 10)
>>> V, F = boolean_union_mesh_mesh(A, B)
>>> union = Mesh.from_vertices_and_faces(V, F)
"""
raise NotImplementedError

Expand Down

0 comments on commit cac1e86

Please sign in to comment.