Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

Scatter points on surface

Share your components here. First one to 100 wins!

Scatter points on surface

Postby ajk48n » Thu Oct 25, 2018 8:24 am

This will automatically scatter new points onto an incoming polygonal SOP. It works similar to the Scatter SOP in Houdini if anyone is used to that.

Just hook up a SOP and choose how many points per polygon you want. Make sure the incoming geo is polygons, not a mesh or something else.

You can also scale the density of where points get created by using the red color attribute on your incoming geometry. See attached .toe file as an example

Update: 21-05-19
I've now updated this to include a C++ plugin which works much faster than the tox, and also has more features like transferring position, color, and normals from the input geo onto the newly created points.

Update: 10-06-19
The c++ plugin has been improved to work with some bug fixes in the latest version of Touch
You can now use a custom attribute to control the density of points (opposed to only the color red in previous versions)

There are also 3 methods to control how the scattering works:

Quick: Simply scatters on every primitive. This is the fastest method, and works best when all triangle in the mesh are around the same size

The next two methods scatter try and give a uniform covering of points regardless of the size of the primitives. They both have pros and cons depending on your geometry.

Bin: The slowest method in most circumstances, but will give a consistent speed no matter the difference in size between the primitives.
If you have mostly large primitives, with only a few small ones, you may see a lack of points in the smaller primitives

Simple: Normally the fastest method, but will be much slower if your mesh has relatively small primitives with only a few large ones.

You can find the plugin file along with a sample toe inside of the C++ Plugin zip file below
Attachments
ScatterPlugin.zip
Scatter SOP Plugin
(17.03 KiB) Downloaded 74 times
scatter_density_example.toe
Script SOP example file
(6.48 KiB) Downloaded 137 times
scatter-v4.tox
Script SOP version
(3.04 KiB) Downloaded 124 times
Last edited by ajk48n on Sun Jun 09, 2019 12:17 pm, edited 6 times in total.
ajk48n
 
Posts: 110
Joined: Sat Jun 06, 2015 3:48 am
Location: Sydney

Re: Scatter points on surface

Postby ajk48n » Mon Oct 29, 2018 8:16 am

This has been updated to remove a bit of the bias in how the points are scattered. They should be less biased towards the center of the primitives now.
ajk48n
 
Posts: 110
Joined: Sat Jun 06, 2015 3:48 am
Location: Sydney

Re: Scatter points on surface

Postby ajk48n » Fri Nov 02, 2018 8:39 am

Updating again to more randomness in point placement. The tox will now automatically convert your input into a mesh which helps with the randomness
ajk48n
 
Posts: 110
Joined: Sat Jun 06, 2015 3:48 am
Location: Sydney

Re: Scatter points on surface

Postby matthewwachter » Fri Nov 02, 2018 3:16 pm

Thanks for sharing! This is a great tool.
matthewwachter
 
Posts: 295
Joined: Fri Jul 08, 2011 3:18 pm
Location: Los Angeles

Re: Scatter points on surface

Postby ajk48n » Fri Nov 02, 2018 6:41 pm

Glad you like it!
ajk48n
 
Posts: 110
Joined: Sat Jun 06, 2015 3:48 am
Location: Sydney

Re: Scatter points on surface

Postby ben » Mon Nov 19, 2018 9:52 am

Nice, very handy!
User avatar
ben
Staff
 
Posts: 2557
Joined: Thu Nov 08, 2007 6:55 pm
Location: Toronto

Re: Scatter points on surface

Postby riorokoko » Sat Dec 01, 2018 10:07 am

Thanks!!great work! is there a way to get the normals of the points(if they have)?
riorokoko
 
Posts: 1
Joined: Mon Aug 06, 2012 7:05 pm

Re: Scatter points on surface

Postby ajk48n » Sun Dec 02, 2018 6:47 am

It would hopefully be possible, although I haven't been able to find a way to sample the incoming geo's normals to place them on the newly created points. I'll have to take another look into that
ajk48n
 
Posts: 110
Joined: Sat Jun 06, 2015 3:48 am
Location: Sydney

Re: Scatter points on surface

Postby ajk48n » Fri May 17, 2019 10:38 am

This has been updated to having varying density of the created points based on the red color attribute of the incoming geometry. See first pose for an example file
ajk48n
 
Posts: 110
Joined: Sat Jun 06, 2015 3:48 am
Location: Sydney


Return to Shared .tox Components

Who is online

Users browsing this forum: No registered users and 6 guests