Hey, guys--how can I place a single point at the topological surface center (not centroid) of a curved surface? This comes after a lot of fracturing and blasting various prims, so the resulting geo is 3D but in the curved-2D sense (vs. extruded/solid). I've tried raying points but based on the shape it will frequently find the closest distance to be right on the edge of the geo instead of nicely in the center using min distance, and using vectors is no better. (This includes raying points that start at the centroid of the pieces.) It's okay if it's not 100% perfect, so if it's easier to do this by removing points of the existing geo instead of scattering a new point that's fine. I think maybe creating per-resultant-piece UVs would be the ticket(?), but I'm not sure how I would make lumpy and not-all-connected geo into pretty square 1x1 UV islands. Perhaps I can abuse the measure sop somehow? Group outside/unshared edges, measure each point to the distance of each edge, average those distances, and grab the point with the closest to a bbox max * 0.5? These things are on the tip of my brain but not spilling out to my fingers on the keyboard.
ADDENDUM/EDIT:
Thinking on this further, I realized that what I want is not so much an exact center of the surface (which would still be nice to know), but more a weighted, center-of-mass-type center (but for a 2D object). On this one I am even slightly more clueless--could a vellum setup calculate a per-point mass which I could then use to extract a weighted center?
Place a point on center of surface
2939 2 1-
- bentway23
- Member
- 133 posts
- Joined: April 2014
- Offline
-
- animatrix_
- Member
- 5096 posts
- Joined: Feb. 2012
- Offline
Hi,
Extract Centroid SOP has an option for computing the Center of Mass:
https://www.sidefx.com/docs/houdini/nodes/sop/extractcentroid.html [www.sidefx.com]
Extract Centroid SOP has an option for computing the Center of Mass:
https://www.sidefx.com/docs/houdini/nodes/sop/extractcentroid.html [www.sidefx.com]
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
-
- bentway23
- Member
- 133 posts
- Joined: April 2014
- Offline
Unfortunately that doesn't work in this case--I want the "center" as if the area were actually flattened and 2D. Since the areas are curved that throws the centroid/center of mass off.
BUT . . .
If anyone deals with this in the future, I figured out a solution. This might not be completely geodesically sound, but it's close enough for what I'm doing. I figure the best way to approximate a 2D "center of mass"-ish thing is to find the point that is farthest away (distance along surface) from all surrounding edges.
First, in case there are various islands of geo, the areas of each are measured and all prims not part of the largest "island" are blasted.
Points on the outside (unshared) edges are grouped.
Using surfacedist, each point's distance to the nearest edge point is measured into @dist. This attribute is promoted to a detail (maximum), and all points except the one with the largest minimum distance to the edges are blasted.
BUT . . .
If anyone deals with this in the future, I figured out a solution. This might not be completely geodesically sound, but it's close enough for what I'm doing. I figure the best way to approximate a 2D "center of mass"-ish thing is to find the point that is farthest away (distance along surface) from all surrounding edges.
First, in case there are various islands of geo, the areas of each are measured and all prims not part of the largest "island" are blasted.
Points on the outside (unshared) edges are grouped.
Using surfacedist, each point's distance to the nearest edge point is measured into @dist. This attribute is promoted to a detail (maximum), and all points except the one with the largest minimum distance to the edges are blasted.
-
- Quick Links

