Translating closed curve causes curve to become open

Hi, I am trying to move a closed curve from a location very far away from the origin closer to the origin for me to work with the curve better due to all the issues that come with working at locations that are very far from the origin. However, when I translate the curve, the resulting curve becomes an open curve.

As you can see, after checking the distance from the endpoint to the startpoint, it is extremely small.
Is this a bug? Or am I doing something wrong here?
Here’s the GH file with the curve internalized. (9.1 KB)

Hi @ongys1992,

What you are seeing a a floating-point rounding error, which can happen when dealing with large floating point numbers. There is a bunch of discussion on the forum about this - just search for far from origin or floating point rounding.

A quick fix is to run the results of the transformation through a C# component that does this:

private void RunScript(Curve curve, ref object A)
  if (null != curve)
    var tol = RhinoDoc.ActiveDoc.ModelAbsoluteTolerance;
    A = curve;

I’ve attached your file modified with this fix. (7.9 KB)

– Dale