Sample closest surface

   4056   2   1
User Avatar
Member
9 posts
Joined: May 2012
Offline
Hello, I'm not too expert in houdini, so i'm stuck with some pretty basic thing
I have a volume, scalar or vector, and a surface or curve with some point attribute. I want each volume cell to take that attribute from the closest to it point of that surface or curve.

Can anyone help?
:(){:|:&};:
User Avatar
Member
606 posts
Joined: May 2007
Offline
I think the Extrapolate mode (default) in Volume From Attribute SOP does just what you need. You just need to resample your curve or subdivide your mesh a bit, at is gets the attribute from the closest point.

For a more convoluted approach, you could:
- get a point grid from volume with Points From Volume
- get the direction to closest point on a surface with a Ray SOP in Minimum Distance mode
- shoot a ray into that direction with another Ray SOP in Project Rays mode and import the attribute you need. (why oh why is this always needed, why can't minimum import attributes..)
- convert back to a volume with Volume From Attribute SOP

This way you don't need to subdivide the surface, but this would fail with curves as you can't really raycast and hope to hit a curve..

Attachments:
voxelfromclosestpoint.hip (52.4 KB)

User Avatar
Member
9 posts
Joined: May 2012
Offline
Wow, thank you! it helped!

the second approach is really closer for me - i really got used to a simple node “get closest location” in softimage, so i look for similar things in houdini.

It's strange though - it'd be very helpful to have a node that returns an interpolated value of an attribute at some location (not just a point) of a surface…
:(){:|:&};:
  • Quick Links