RenatoT Yes, P is the position of the current shading point.
Imagine the two scenarios. A point within the welding radius, and a point outside the welding radius. What are the conditions for both?
If we disregard the welding overlapping, i am only interested in the closest point. In the simplest case, you can reason that if the distance between the shading point and the closest curve point is smaller than the welding radius, we should displace. If the distance is larger than the radius, no work needs to be done.
That’s all there is to it really.
By saying the shader takes curve points as inputs, that’s exactly what i mean. No other user data is required to generate the effect, only the point positions of the curves. I just embedded them into the code to make everyone’s life easier. Still have to figure out how to pass an array to OSL in the arnold implementation.