Hello everyone,
I am trying to scatter some points on a circle. But I want the points to be scattered more near the center and less towards the outer side. In the old Houdini Scatter I could do it by making my Circle Primitive type to “Polygon” and then uncheck “Divide Non- Convex Polygon” on the scatter node. However, in the new scatter node of Houdini 14 and 15, this option is not available.
Here is what I am trying to achieve, this is with the old scatter node.
http://imgur.com/9uDTc14 [imgur.com]
This is what I am getting with the new scatter node in Houdini 14 and 15.
http://imgur.com/OEmTuYc [imgur.com]
Please help.
How to scatter more points near the center of a primitive or polygon circle.
7144 3 2- Mohit Pundir
- Member
- 1 posts
- Joined: 9月 2015
- Offline
- neil_math_comp
- Member
- 1743 posts
- Joined: 3月 2012
- Offline
Mohit PundirYep, that was a bug with the old Scatter SOP, because you couldn't control the actual distribution. It was just whatever it happened to generate.
In the old Houdini Scatter I could do it by making my Circle Primitive type to “Polygon” and then uncheck “Divide Non- Convex Polygon” on the scatter node.
Now, it defaults to uniform density, but you can control what the actual density near the edge and in the middle are with a point attribute. Set the Circle SOP's Arc Type to Sliced Arc. You can create a “density” attribute and set it to, for example, 1.0 for the middle point, and 0.0 for the rest of the points, (e.g. with a Point Wrangle SOP with point group 0 and code “@density = 1.0;”. Turn on the Density Attribute option on the Scatter SOP.
If you want a different profile for the distribution, you can use the Edge Divide SOP with Connect Points enabled to divide all of the edges going to the centre point, (make sure to Fuse point 1 and the last point in the Sliced Arc first, though, ‘cause they’re coincident, and it's hard to select both coincident edges). Then, you can control the density at different distances from the centre point, e.g. “@density = exp(-5*length(@P));”. In the attached example, try sliding the Bias parameter on the Attribute Wrangle SOP to see the some simple effects you can get along those lines.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
- Poolena90
- Member
- 1 posts
- Joined: 7月 2017
- Offline
ndickson
Now, it defaults to uniform density, but you can control what the actual density near the edge and in the middle are with a point attribute. Set the Circle SOP's Arc Type to Sliced Arc. You can create a “density” attribute and set it to, for example, 1.0 for the middle point, and 0.0 for the rest of the points, (e.g. with a Point Wrangle SOP with point group 0 and code “@density = 1.0;”. Turn on the Density Attribute option on the Scatter SOP.
Could you also do an example of this part version to? Your second recommendation works great I'd love to see what the first recommendation looks like.
- neil_math_comp
- Member
- 1743 posts
- Joined: 3月 2012
- Offline
I think the attached is what I was thinking. It's much simpler than the Edge Divide approach.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
-
- Quick Links