Jump to content
Sign in to follow this  

Automatically count how many copies needed to fill area

Recommended Posts

I am currently scattering points on a area that I then copy objects to. In this case the area is the trunk of a tree and the objects copied to the points are bark pieces.

My question is, is there a way for Houdini to measure the Trunk area and then measure the bark pieces to then count how many bark pieces are needed to cover the whole trunk? At least a rough estimate would be wonderful as a start for the points scattered. I am using pscale for the bark pieces so if there is a way to count that in.




Edited by hampuseh

Share this post

Link to post
Share on other sites

Well for the scatter node, the density scale is measured per m^2, so if you use a measure SOP to measure the area (it will be set to perimeter by default)
you can then use an attribute promote SOP to promote the area from primitive to detail, using the "sum" method.

you now should have the total surface area as a detail attribute.

Then you can fetch that attribute, and divide it by the size of your bark pieces, times some kind of smudge factor and put that as the density in you scatter node.
That should give you a reasonable filling in :) 

  • Like 1
  • Thanks 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this