Point to Connected Primitives

   13257   9   2
User Avatar
Member
10 posts
Joined: July 2006
Offline
Hello everyone,

I have set up a wall of fragmented bricks (polygons), and would like to select a number of fragments based on a bounding volume. Each fragment consists of several primitives. Using the Select tool in the viewport I can interactively select connected primitives, which will select whole fragments.

Q1: Is there any way to simulate this “Select connected primitives” mode in a node network?

I know I can select points by a group SOP using a bounding volume, and then use another group SOP to convert the point selection to a primitive selection, but this way Houdini only selects the individual primitives the points are a part of, but not the connected primitives (the whole fragment).

Q2: Is it possible to convert a selection of points or primitives into the number of connected primitives that they are a part of?

Thanks for any help.
User Avatar
Member
10 posts
Joined: July 2006
Offline
hmm… I may have just found something, but I don't know if that's a good solution really.

If I convert the point selection to a primitive group, then convert that primitive selection to its points again, to another primitive group, back to points and so on, I can ‘grow’ the selection of points/primitives up until all connected primitives are selected. So it's group SOP after group SOP.

I wonder if there's any other way… ?
User Avatar
Member
4270 posts
Joined: July 2005
Offline
Connectivity SOP might help to some degree.

Attachments:
groupConnected.hip (45.9 KB)

if(coffees<2,round(float),float)
User Avatar
Member
10 posts
Joined: July 2006
Offline
Hi Wolfwood,

Thanks for your hint & hip. It seems to work, but it's really slow. But I think you pointed me in the right direction.

I'll post again if I find another (faster) solution.

Cheers!
User Avatar
Member
2199 posts
Joined: July 2005
Online
dr.pepper
hmm… I may have just found something, but I don't know if that's a good solution really.

If I convert the point selection to a primitive group, then convert that primitive selection to its points again, to another primitive group, back to points and so on, I can ‘grow’ the selection of points/primitives up until all connected primitives are selected. So it's group SOP after group SOP.

I wonder if there's any other way… ?

Just for information you can grow a selection by a number of edges using the group sop - edges option. It used to only take a single point number, but now you can give it an entire group.
The trick is finding just the right hammer for every screw
User Avatar
Member
10 posts
Joined: July 2006
Offline
That's it Simon!!

Here's what I do now:

I have a Copy SOP defining the set of fragmented bricks (bricks of different types copied on a grid).

1) Group SOP: Create group of points by bounding volume
2) Group SOP: Create group of points by edges with Edge Depth set to 100 and Point Group set to the name of the group defined in 1)
3) Group SOP: Convert group of points created in 2) to a primitive group

So there are 3 Group SOPs for each cluster of brick fragments defined by a bounding volume, and it's lightning fast.

Thank you guys for your help!
User Avatar
Member
1632 posts
Joined: July 2005
Offline
If you're using the Copy SOP, you can use the Create Output Groups to do what you want. Toggle it on and specify the following in the Copy Groups parameter:
copyGroup$TPT

If you MMB on the Copy SOP, you should see
n Primitive Groups:
n primitives in copyGroup0
n primitives in copyGroup1
n primitives in copyGroup2
… etc

From the Copy SOP's Local variables help tab:
TPT - The actual point number of the currently processed template point, independent of any template groups. See PT above.

Hope the above helps!

Cheers!
steven
User Avatar
Member
10 posts
Joined: July 2006
Offline
Hi Steven,

Thanks for the hint. I'm already using that option, but the bricks I create on the grid consist of several fragments (individual objects) that each have a unique group name already. The problem was to select fragments from several different bricks by using a bounding volume. It works using the 3-group solution described above.

Thanks again anyway.

Cheers!
User Avatar
Member
10 posts
Joined: Oct. 2010
Offline
dr.pepper
That's it Simon!!

Here's what I do now:

I have a Copy SOP defining the set of fragmented bricks (bricks of different types copied on a grid).

1) Group SOP: Create group of points by bounding volume
2) Group SOP: Create group of points by edges with Edge Depth set to 100 and Point Group set to the name of the group defined in 1)
3) Group SOP: Convert group of points created in 2) to a primitive group

So there are 3 Group SOPs for each cluster of brick fragments defined by a bounding volume, and it's lightning fast.

Thank you guys for your help!

Hey dr. Pepper, can you please share your HIP file where you use this method? Seems I can't quite get it from the explanation
User Avatar
Member
10 posts
Joined: Oct. 2010
Offline
Sifis
Hey dr. Pepper, can you please share your HIP file where you use this method? Seems I can't quite get it from the explanation

Oh, I've finally make it work, thanks a ton dr pepper,It works perfectly!
  • Quick Links