3
$\begingroup$

I'm trying to get a dynamic contact point for a shrinkwrap modifier. The normal projection of the shrinkwrap is not enough in my case, as i need the closest point of another surface. However i'm not having any luck in getting the values from the raycast back that i need.

Here is my current setup: enter image description here I would want to get the shortest ray, and at its hit point i want to spawn a simple icosphere, or other mesh. In my mind its quite simple to achieve, but i cant get it to work.

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ Just a few thoughts: It doesn't work this way because you use the sphere's Geometry for the Set Position and since the Ray Cast node also is connected to it, the Ray Cast node uses the sphere to cast rays from it. The Set Position node will move the vertices of the sphere to the hit position (=shrinkwrap the sphere). You need to do something with the circle's geometry (Group Input > Geometry). Also, you need the closest hit position. Maybe Attribute Statistics helps but this can only get you one value. You need the distance & location... you probably also need a Sample node... $\endgroup$
    – Blunder
    Feb 19 at 3:23
  • 1
    $\begingroup$ You need 2 Attribute Statistic nodes then it kinda works. I'm just curious what do you need this for? The shortest distance makes the sphere jump over pits and stick it to bumps. Here is a demo: i.stack.imgur.com/J3nVt.gif. It reveals that the sphere sticks half into the ground because the origin is in the center. So I guess you have to move it "back" along the normal of the floor plane to gently touch the floor. $\endgroup$
    – Blunder
    Feb 19 at 4:39
  • $\begingroup$ Thank you booth for your Tipps! I'll try it asap :) i need to visualize a theoretical contact point of a tire to the ground. I'll Post my result $\endgroup$
    – Chris
    Feb 19 at 10:56

1 Answer 1

3
$\begingroup$

Since your source-object is circular, can you dispense with ray-casting altogether and just find the closest point on the target-plane, to source (0,0,0) ?

enter image description here

Which does this:

enter image description here

$\endgroup$
1
  • 2
    $\begingroup$ And for non-circular object you could go through the bottom curve, capture the attribute of the distance to the nearest point on the top object, then use a statistics node to find the minimum, then find the lowest index with such value as the distance and then sample the point with that index. $\endgroup$ Feb 19 at 11:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .