Procedural grouping (grouping leafs of a tree)

   4512   7   1
User Avatar
Member
41 posts
Joined: 2月 2006
Offline
Hello,

I have this crude tree, and I want to select all ‘leaves’. I thought of selecting all edges that are inside the leaf parts (I highlighted some examples in red), and convert those to primitives - all this with the Group SOP. Any ideas for achieving that?
Edited by alexpi - 2016年12月3日 07:59:45

Attachments:
treeSC.JPG (72.5 KB)

User Avatar
Member
2625 posts
Joined: 6月 2008
Offline
Middle click on the File node that imports the tree and see if any groups already exists? Then you could just select from the existing groups. Most tree models already have this built-in. (i.e. trunk/bark, leaves)
Edited by Enivob - 2016年12月1日 09:22:53
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
41 posts
Joined: 2月 2006
Offline
Thanks Enivob. I am doing this as an exercise, so I was searching for a way to accomplish this using expressions, or a SOP I probably am not familiar with.
User Avatar
Member
41 posts
Joined: 2月 2006
Offline
To simplify my question, is there a way to make one group containing every distinct (with border edges) piece of geometry, that is comprised of n number of primitives? In my example above, that would select all leafs (2 prims) and no trunk or branches.
User Avatar
Member
2625 posts
Joined: 6月 2008
Offline
Can you post the source tree file?

Mainly because it depends upon how the primitives are arranged within the source object. For instance all the leaves might have been created last thus have a higher primitive index compared to branches. If that were the case then you could create a group by simply evaluating each @primnum in a wrangle.
if (@primnum >150) {
    i@group_bottom_half = 1;
}
Maybe each primitive has a specific vertex count that makes it detectable..?
Edited by Enivob - 2016年12月3日 09:39:58

Attachments:
Untitled-1.jpg (125.9 KB)
ap_group_by_logic_delete.hiplc (56.6 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
41 posts
Joined: 2月 2006
Offline
The tree file is too big (32MB) to upload. The primitives are not in arranged in a particular way. The leafs are not connected to the tree, they just float arround, and all of them are just these two prim squares. The only way I can think of achieving the grouping, is adding any geometry that has two prims to a group, perhaps by some kind of looping.

Attachments:
tree.JPG (365.3 KB)

User Avatar
Member
2625 posts
Joined: 6月 2008
Offline
This thread [sidefx.com] mentions a work flow of an Assemble SOP followed up by a Partition. Maybe that is the way to go?
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
133 posts
Joined: 7月 2005
Offline
Here is one way to do it. As long as the leaves are only features with two connected primitives.

Attachments:
treesep.hip (82.9 KB)

  • Quick Links