Need help debugging a problem

Could someone help me find out why do I get negative number for max-deviation line Y coordinate, when all the points of the curves in scope have positive Y and Z coordinates.

image

something _wrong.gh (22.9 KB)

Update: Thread where the component was created. Just adding it for navigation purposes.

Update:
@piac, when you have time could you help me with this. On the above mentioned thread there’s a csharp component that I translated to python, for me they are the same but there’s some bug in my Python translation that causes this.

Anyone?

I have no idea what the rs function does, but shouldn’t it be:

maxDptA = curveA.PointAt(maxA)
maxDptB = curveB.PointAt(maxB)
minDptA = curveA.PointAt(minA)
minDptB = curveB.PointAt(minB)

?

No, it is connecting the min deviation point of curveA to min deviation point of curve B, and respectively maxDpt from crvA with maxDpt from crvB. Creating lines between them.

The issue is that using the same algorithm in Csharp works but Python doesn’t.

Update:

something _wrong.gh (25.3 KB)

Your C# Script:

    var maxDistPtA = curveA.PointAt(maxDistanceParameterA);
    var maxDistPtB = curveB.PointAt(maxDistanceParameterB);
    var minDistPtA = curveA.PointAt(minDistanceParameterA);
    var minDistPtB = curveB.PointAt(minDistanceParameterB);

Your Python Script:

    maxDptA = curveA.PointAt(maxA)
    maxDptB = curveA.PointAt(maxB)
    minDptA = curveB.PointAt(minA)
    minDptB = curveB.PointAt(minB)

Both codes would be the same if you’d have:

    maxDptA = curveA.PointAt(maxA)
    maxDptB = curveB.PointAt(maxB)
    minDptA = curveA.PointAt(minA)
    minDptB = curveB.PointAt(minB)

Or in words: you are taking a parameter referring to curve B which is called maxB and evaluate curve A with it, and vice versa. If you still have doubts, adjust your code as suggested in the previous post, they then produce identical results.

How very interesting.

You know I worked with this component ever since I wrote it, and had no problems, but once I scaled a huge model to work with meters I noticed there’s something wrong.

That’s why they say 4 eyes are better than 2.

Thanks a lot