Locations

from geomdb import *
from geomdb.loc import Everywhere, BoundingBox, Plane, plot

# For visualization
from geomdb.utils import scene_to_notebook

# We can use GPU... but as the default jax is cpu-only, let's disable the "GPU not found" warning for now.
import jax; jax.config.update('jax_platform_name', 'cpu')

Create a voxelation

voxel = voxel_from_stl("data/stanford-bunny.stl", 2)
lower_left_corner, upper_right_corner = voxel.bounds

Bounding box selection

bb = BoundingBox(lower_left=lower_left_corner, upper_right=[31, 3, 49])
scene_to_notebook(plot(bb, voxel))

Plane selection

pln = Plane([30,0,0], [0.6,-0.8,0], tol=0.5)
scene_to_notebook(plot(pln, voxel))

The ~ operator defines the complement of a selection

scene_to_notebook(plot(~bb, voxel))

New selections can be composed from existing ones, e.g., |, &, ^

scene_to_notebook(plot(bb | pln, voxel))