Stoke Genome Mod - loop selected face into entire element

Hi Bobo,

A while ago on the old Genome board, you spoke of the possibility with genome 2.0 to create a flow that would take a stack vert/face selection and loop through, selection verts/faces until an entire element was selected. I am trying to build a element volume selector in genome, but I cannot quite figure out how to wire it up - can you shed some light on how we might do this?

Thanks,
Bob Dyce

Here is an example.
Keep it mind that it is a bit slow with complex meshes because it does one loop through all faces for every face.

Basically, it takes the Element index of the current Face and goes into a loop where it loops through all faces in the mesh and compares the Element index to the one of the current face, and collects the selected and unselected counts for that Element. Then if the factor of selected to unselected is above a user-defined threshold, the current face gets selected. Thus, if you enter 0.5 for the threshold, a face will be selected if half or more of the element’s faces are selected. If you set it to 0, it will select even if only one face of the element is selected. A value of 1.0 will select the element only if ALL faces are selected.

In my example, I used an animated Vol.Select sliding over a Teapot to select the elements with a threshold of 0.5.

Hope this helps!
GNM_SelectElementByFaceSelection_v011.zip (24.7 KB)

Thanks - that’s pretty cool. I was sending a volume selection of faces up the stack and using the standard growing selection mod shown here:
thinkboxsoftware.com/gnm-gro … ction-mod/ - No so fast and not smart enough to determine the element index.

In my case, I had to just iterate high enough that the entire element would be come selected (about 40 iterations). You method is super clever with the exposed threshold - very cool. Unfortunately I am trying to do this to an XMESH with over a million faces and it is super slow. I may have to go back to the drawing board on this one!

Thanks for the flow - I’ll add it to the collection. We have dozens of Genome mods saved that we are using in production constantly. I often find myself saying “How the hell would someone do this without Genome?” To which the answer is often: Do it in Houdini, ICE, write a custom plugin, etc.

Thanks!

Bob Dyce

If we want to speed this up in the future, we would need two additional features - the ability to run a pre-pass outside of the regular implicit loop (using only Loop nodes to iterate), and the ability to accumulate, pass to the main loop and read generic data that is not connected to the sub-object element being iterated over.

So in your case, the pre-pass (Initial) flow would do a Loop over all elements with an inner loop going through all faces, once per element. This would collect the “selection factor” data in an “array” structure with as many entries as there are elements.
Then the main Faces iteration would just read the FaceElement channel, use it to look up into the “array” data of the pre-pass and see if the element was considered selected or not.
This way, with 1 million faces in 10 elements, the Initial loop would do 10x1M iterations, and the main loop would do a million more for a total of 11 million iterations, vs. a trillion (1 million x 1 million) iterations!