Distribute points (randomly) in a mesh with an increase in density towards the center (Points from Volume)

   8276   6   2
User Avatar
Member
4 posts
Joined: Feb. 2017
Offline
Hello,

I'd like to randomly distribute points in a sphere but I'd like to increase density towards the center of it.

It took me some time to realise that I can't use the Scatter Node to distribute them inside a mesh, and so I use the Points from Volume Node.

In another thread [sidefx.com] I found basically what I was looking for, except it uses a plane and the Scatter Node. How do I translate this into a volume?
(Ideally I could controll the density with a ramp from surface to center.)

Attachments:
scatter_points_density.png (578.6 KB)
points_from_volume.png (318.9 KB)

Houdini FX Apprentice 16.0.504.20
Windows 10 Pro 64 Bit
i7 6700k @ 4.5GHz
32GB Ram
970 GTX 3.5gb VRam
User Avatar
Member
8 posts
Joined: Aug. 2007
Offline
You can put a isooffset to convert the geometry to a volume and then scatter works. As for the density effect you could after the scatter node blast some points based on the distance.
Technical Director / Co-founder
You can do it! VFX
Lisbon / Porto
Portugal
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
If you generate an SDF type volume with the Iso Offset SOP and negate the SDF with the toggle, then pass this in to Scatter SOP you will get naturally get more points the further you are inside and away from the surface.

See the attached hip file for a complete exploration of scattering points in to SDF volumes. Please read the notes in the SOP network. When modifying SDF volumes it is important that you let anyone working with modified SDF volumes that it is no longer representative of the incoming geometry.

I added a Ramp Parameter option in a Volume VOP to remap the SDF to whatever you want as well.

Hope this helps.

Attachments:
non_linear_scatter_distribution_in_volume.hip (1.5 MB)

There's at least one school like the old school!
User Avatar
Member
9 posts
Joined: July 2013
Offline
Is there any way to scatter points on actual volume grid based on the density?

This is what I have when trying to scatter with Points from Volume made by Pyro. Any way to get rid of the voxels?

Attachments:
scattervoxels.JPG (148.8 KB)

User Avatar
Member
142 posts
Joined: Aug. 2009
Offline
what do you want to achieve ?
User Avatar
Member
9 posts
Joined: July 2013
Offline
I want to render Pyro sim with particles. The usual workflow would be to advect particles by Pyro vel, but as I need only one frame and billions of particles, just looking for a simpler and more efficient way
User Avatar
Member
33 posts
Joined: July 2017
Offline
Maybe you can first scatter billions of points in your volume.
After that you sample your density to the points and delete a percentage of it based on the density. For example if the density is one you are going to keep all the points inside the voxel, if the density is 0.1 you keep just the 10% (you can do it by give to the point a random number and compare it to the desired percentage, but I think you already know how to do it )
Edited by Andrea Sbabo - Jan. 31, 2020 15:51:32
FX Artist - Scanline VFX
  • Quick Links