Add Suzanne
Convert Suzanne mesh to volume.
Distribute points in volume.
Set Position offset in Z to have half of the point outside of the volume area.
Convert Suzanne to convex hull and join with the other geometry.
Q1 : How to delete the points that are not within the volume/convex hull region?
Q2 : If instead of distribute points in volume we have another mesh, a single object consisting of 100 mesh islands. How can we detect verts on that object that are not within the volume and then delete all verts of the mesh island that vert belongs to?
We could try sampling the nearest surface of the “volume” mesh and seeing whether we’re looking on the “inside” or “outside” of the mesh, i.e. reading surface normal and comparing to vector from surface to point (with Dot Product). If they look in the same direction return True - that’s selection for Delete Geometry node.
I am assuming any possible alternative to boolean is going to be faster than boolean.
I have thousands of pieces of randomly shaped christmas confetti in a glass jar or a box made of a hundred wires (curves). Using boolean to trim away the pieces that go through and poke outside of the container walls is ssslllooooowww.
An easy fix is to subdivide the confetti mesh once or twice so there is an actual vertex in the area outside of the volume. But, is it possible to detect if part of the face/edge is outside of the mesh, not just the vertices?
An idea: for each Edge, Raycast from “Edge Vertex” Position1 in the direction of Position2. If the ray hits the Target - then the edge is intersecting the surface… at least once.
That should get you all the islands that have edges go through surface… probably.
Add the selection from outside and delete them all.