GetDistancesBetweenCurves


#1

Hi,

I’m using GetDistancesBetweenCurves with the curves of the added file, and the function fails. It always returns false.

Tolerance = 0.001;
bool done = Curve.GetDistancesBetweenCurves( curveA, curveB, Tolerance, out maxDistance, out maxDistanceParameterA, out maxDistanceParameterB, out minDistance, out minDistanceParameterA, out minDistanceParameterB );

Is there any problem with this function?

Thanks

curveDistanceFail.3dm (77.6 KB)


(Dale Fugier) #2

The Curve.GetDistancesBetweenCurves method is basically the equivalent of the CrvDeviation command. Since the curves to not overlap, the function returns false. Does this help?


#3

Ok. So this function does not compute the distance between two arbitrary curves?

Reading the function’s help, led me to mistake.

    // Resumen:
    //     Computes the distance between two arbitrary curves.
    //
    // Parámetros:
    //   curveA:
    //     A curve.
    //
    //   curveB:
    //     Another curve.
    //
    //   tolerance:
    //     A tolerance value.
    //
    //   maxDistance:
    //     The maximum distance value. This is an out reference argument.
    //
    //   maxDistanceParameterA:
    //     The maximum distance parameter on curve A. This is an out reference argument.
    //
    //   maxDistanceParameterB:
    //     The maximum distance parameter on curve B. This is an out reference argument.
    //
    //   minDistance:
    //     The minimum distance value. This is an out reference argument.
    //
    //   minDistanceParameterA:
    //     The minimum distance parameter on curve A. This is an out reference argument.
    //
    //   minDistanceParameterB:
    //     The minimum distance parameter on curve B. This is an out reference argument.
    //
    // Devuelve:
    //     true if the operation succeeded; otherwise false.

Thanks.


(Dale Fugier) #4

The help should read, “Reports the maximum and minimum distances between two curves that overlap.” I will see to fixing this.