Genome Volume Selection
The Genome modifier can perform a lot of the features of the 3ds Max Vol.Select modifier, including the test for a point inside a mesh, but in many cases it is faster and more flexible.
Selecting Using One Or More Meshes
In the following example, a Teapot's vertices will be tested against one or more mesh volumes using the InVolume operator:
RESULT: The vertices inside the Torus will be selected (left image). Adding a Geosphere to the InputGeometry list will select vetices that are in either volume (right image):
Selecting The Intersection Of Two Sets Of Meshes
Instead of selecting a vertex if it is in either the one volume or the other, we can expand our flow to use two (or more) InputGeometry nodes and compare the result of their InVolume operators using a LogicalAnd operator.
RESULT: Only vertices that are inside both the Torus and the Geosphere will be selected.
By simply switching the Logical operator from LogicalAnd to LogicalXor, we can select the vertices that are selected only in one of the InputGeometry sets of meshes or the other, but NOT in both:
Performance Of IntersectRay With Closed Meshes
The InVolume operator performs a set of tests to determine the inside/outside conditions and can be slow. Still, testing 131,330 vertices in a 64 segments Teapot using a Geosphere with 64 segments and 81,920 faces produces the following benchmark results over 100 frames with both objects moving via position keyframes:
- 3ds Max Volume Select: 733.99 seconds
- Genome InVolume test: 330.164 seconds (2.22 times faster than 3ds Max Volume Select)
- Genome IntersectRay test: 34.65 seconds (21.18 times faster than 3ds Max Volume Select)
Here is the above XOR selection test using the Torus and Geosphere, converted to IntersectRay Distance tests. It produces identical results as InVolume, but faster:
This test shoots a ray along the vertex normal and checks the distance to the mesh intersection - if the Distance value is negative, the mesh was hot from the inside. Assuming the mesh is mostly convex and closed, this means the vertex is inside its volume.