Zero length curve extending

How is this curve extending?, trying to mimic the grasshopper script in a C# script, I get the same two lines one with length and the other with 0.00 length but in the grasshopper script it extends unlike the C# script, my mind will explode on how is this curve extending and how did it decide the vector for extension


It’s impossible for us to tell without seeing your code. Please post the file with internalized geometry.

Here is the grasshopper script, if there is a way to mimic the same process with same outputs in C# it would be much appreciated. (8.3 KB)

There is no c# in there…

I used the Curve.Extend method and I have the same behaviour with the component or code, that is, the line extends in direction that appears to be random… But it’s not. The thing is, the line doesn’t have exactly 0 length. So it has a direction. See there test for equality is False. This is a nasty rounding error. (17.3 KB)

The problem was concerning the grasshopper script that’s why I didn’t attach the C# script, I figured it would be a problem of decimals, but I wasn’t convinced knowing that Point3d class doesn’t take decimals, only doubles so I thought it would give the exact coordinates, much appreciation for the help

By any chance, is there a way to apply the pull point logic in C# ?

If inputs the same point, the line will be invalid.

1 Like