Efficient and Precise way to group points Inside Geo?
977 11 1-
- olivierth
- Member
- 1264 posts
- Joined: April 2017
- Offline
Hi!
I have 2 spheres coliding. I want to group all points from my scatter inside of those spheres. When I use the Group sop (set to Keep in Bounding Regions), it doesnt group points in the colision area.
I ended up using a boolean to combine the spheres and also split all edges to move each points appart by 0.0001 (helps a lot). But I still get some points not getting grouped inside the sphere.
Any other method to do this perfectly everytime?
I have 2 spheres coliding. I want to group all points from my scatter inside of those spheres. When I use the Group sop (set to Keep in Bounding Regions), it doesnt group points in the colision area.
I ended up using a boolean to combine the spheres and also split all edges to move each points appart by 0.0001 (helps a lot). But I still get some points not getting grouped inside the sphere.
Any other method to do this perfectly everytime?
-Olivier
-
- olivierth
- Member
- 1264 posts
- Joined: April 2017
- Offline
Found a method. Same as before but with some extra steps before grouping the points.
I do an extra boolean on the side in the Shatter mode. On the shattered one, I only keep the inside polygons. I group it in a "inside" prim group before re-merging with the Unioned spheres. When I use the xyzdist, I check if I hit the "inside" primitive. If so, The points are grouped.
I do an extra boolean on the side in the Shatter mode. On the shattered one, I only keep the inside polygons. I group it in a "inside" prim group before re-merging with the Unioned spheres. When I use the xyzdist, I check if I hit the "inside" primitive. If so, The points are grouped.
-Olivier
-
- FedorK_FX
- Member
- 43 posts
- Joined: Jan. 2016
- Offline
-
- olivierth
- Member
- 1264 posts
- Joined: April 2017
- Offline
-
- Mike_A
- Member
- 436 posts
- Joined: Aug. 2018
- Online
If your collision objects are spheres, and there are just two of them, then perhaps another approach is to 'extract centroid' from each sphere and plug then centroid points into the second (1) a third (2) inputs of a wrangle to check the point distance from each sphere's centre, and put them in a group:
(Assuming a sphere radius of 0.5 in this example)
(Assuming a sphere radius of 0.5 in this example)
float dist1 = length(point(1, "P", 0) - @P); float dist2 = length(point(2, "P", 0) - @P); if (dist1 < 0.5 && dist2 < 0.5) { setpointgroup(0, "inside", @ptnum, 1, "set"); }
Edited by Mike_A - Oct. 14, 2026 17:33:17
-
- tamte
- Member
- 9744 posts
- Joined: July 2007
- Online
it's not clear to me whether you want to group all the points within any of the spheres, or just within the intersection of all spheres etc
but regardless, for arbitrary geo you can use windingnumber() VEX function to check whether the point is within the geo and how deep in case the geo contains intersections

for just spheres I agree that it's better to either use points with pscale or sphere primitives and iterate over them in for loop in VEX
or depending on number of points and colliders you can also use pcfindradius() if things get heavy,
but regardless, for arbitrary geo you can use windingnumber() VEX function to check whether the point is within the geo and how deep in case the geo contains intersections
for just spheres I agree that it's better to either use points with pscale or sphere primitives and iterate over them in for loop in VEX
or depending on number of points and colliders you can also use pcfindradius() if things get heavy,
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- Mike_A
- Member
- 436 posts
- Joined: Aug. 2018
- Online
-
- Konstantin Magnus
- Member
- 753 posts
- Joined: Sept. 2013
- Offline
A very precise way of grouping points inside sphere intersections might also be using implicit spheres.
The implicit surface operation-node comes with all sorts of boolean operations to choose from.
The implicit surface operation-node comes with all sorts of boolean operations to choose from.
Edited by Konstantin Magnus - Oct. 15, 2026 12:12:37
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
-
- olivierth
- Member
- 1264 posts
- Joined: April 2017
- Offline
Hi!
The sphere were just an example. It could be any geo shape. And, I want to group any points that are not outside. So all points inside any geo, coliding or not.
The windingnumber function looks nice but I don't have it in my H19.5 sadly.
But, my solution works well. If it gets slow, I'll see if I can migrate to a newer version of Houdini for the windingnumber function.
The sphere were just an example. It could be any geo shape. And, I want to group any points that are not outside. So all points inside any geo, coliding or not.
The windingnumber function looks nice but I don't have it in my H19.5 sadly.
But, my solution works well. If it gets slow, I'll see if I can migrate to a newer version of Houdini for the windingnumber function.
Edited by olivierth - Oct. 20, 2026 11:07:04
-Olivier
-
- Konstantin Magnus
- Member
- 753 posts
- Joined: Sept. 2013
- Offline
Hi olvierth,
how about grouping points based on a signed distance field? Converting multiple meshes to VDBs is very forgiving.
how about grouping points based on a signed distance field? Converting multiple meshes to VDBs is very forgiving.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
-
- tamte
- Member
- 9744 posts
- Joined: July 2007
- Online
-
- olivierth
- Member
- 1264 posts
- Joined: April 2017
- Offline
-
- Quick Links



