Algorithm used in Curve Proximity

Hi,

Is there any hint about the algorithm used in Curve Proximity Component? I found that this component output strange result in some situations. I want to know why the situation happen, and what I should be careful when I use this.

The situation:
There are two curves, one of which is a circle and the other is a line. The line length is a variable. When I changed the line length from 0 to 2000 gradually, the outputs of Curve Proximity take strange points in certain ranges.

I hope you will be able to provide the information. Thank you,
Ren


ezgif-2-fd6b98a7cf45
curve_proximity.gh (20.1 KB)

wow

wierdly enough: by changing the seam of the circular curve, for some seam positions the result is correct


curve_proximity_withSeams.gh (13.9 KB)

Thank you for testing.
It seems sure that the seam of curve also affects the results.
Still more difficult to understand…

The problem is that the curve proximity between 2 intersected curves is always the intersection point.
As shown below:


Good Luck!

1 Like

I think we all agree with that :slight_smile:

but for two curves which are not intersecting, this looks like very wrong behavior (white dots should indicate the curves reciprocal closest point)
…am I completely crazy? :smiley:

[edit: sorry, I forgot to mention you can reproduce this very same behavior by setting the seams to 0.0 in my previous definition, and also see the results being inconsistent while varying the seams slider: for some seams values it indeed works as it should, for other values it doesn’t…]

Using the Rhino Common method the outcome seems to be consistent:


File:20210508_CurveProx.gh (15.1 KB)

1 Like

Thank you for your information. The Rhino Common method works well! It seems more certain to use this method.

As a trial, I changed the value of tolerance of GetDistancesBetweenCurves method into 0.01, 0.1, 1, 10, 100 and watched if the result got to be similar to the case of Curve Proximity, which turned to be no. So the tolerance is not the main reason of this problem. The algorithm may be problematic…? :thinking:

I suppose that the GH component uses another algorithm for some reasons.
The person who probably knows more is the creator of GH. I don’t tag him here, since it is not that important to me. By the way it’s a while since I saw him here :thinking:

I have red somewhere that most of the efforts are focuse into GH2 (and I’m soi happy about it)

of course, I believe it is important to know and share if some components have any weird behavior like in this case, this forum is precious

but I also would not steal even 1 minute from the developers to fix something in GH1 if they are working on GH2 :slight_smile: even if release date would be 2025 :slight_smile:

1 Like

I totally agree!