Projecting correctly onto this target surface?

   1229   4   1
User Avatar
Member
73 posts
Joined: 4月 2020
Online
Hello Experts,

In my search for this topic in the forum I found some posts that were close, but not quite what I'm looking for. (There was an interesting one about tiling roofs, for instance.) My apologies if I've missed the answer.

My problem is that I have two surfaces -- a little one and a target one. The little one (in green) sits "above" the target one.

I want to project the little surface onto the target surface in the direction of the surface normals. I am clearly not understanding how to do this. I've tried 4 different methods.

The first is to project the little surface straight down using a ray SOP with a vector. This works robustly but in areas of steep slopes, it cuts short the resulting surface.

The second uses a ray SOP to project from the little surface to the target surface using the normals of the little surface. But I get horrid results.

The third tries to project from the target surface up to the little surface using a ray SOP and the target surface normals, and then separate out the points that hit. This is even more horrid.

The fourth does a vdbfrom particles on the little surface with the particle radius large enough to intersect with the target surface. I then convertvdb to polygons and do a Boolean intersection to get the resulting surface. This too is robust, but the resulting surface extends past where I'd like it too, due to the radius of the particles.

Does anyone have suggestions about what I should be doing to get better results? The surfaces.hip file is at the bottom of this post. I have no idea why the images are included again, sorry...

Thanks you so much,
Mary
Edited by mgbaker - 2023年3月5日 16:55:42

Attachments:
surfaces.png (493.4 KB)
vertical projection.png (559.0 KB)
projection from little surface.png (593.6 KB)
projection from target surface.png (522.5 KB)
vdb intersection.png (553.2 KB)
surfaces.hip (2.9 MB)

User Avatar
Member
82 posts
Joined: 6月 2020
Offline
I think in this case using the "minimum distance" method on the Ray SOP will give you the best results.
Edited by freshbaked - 2023年3月5日 22:17:02
User Avatar
Member
73 posts
Joined: 4月 2020
Online
Thanks, freshbaked. I did try that as well, but the problem I found was that in concave corners the minimum distance can sometimes spread the projection out to either side of the corner, since reaching into the corner isn't the shortest distance. Here's my (very bad) illustration of the problem:

Or am I misunderstanding something?

Thanks!
Mary

Attachments:
corners.png (29.3 KB)

User Avatar
Member
4495 posts
Joined: 2月 2012
Offline
Hi,

You can easily do this by attrib transfering normals from the large surface to the small surface, blur normals optionally, and then use Ray SOP after with the Normal option and then delete N.

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
73 posts
Joined: 4月 2020
Online
Thank you, animatrix_,that works brilliantly!

Best wishes,
Mary
  • Quick Links