New Curve Offset 10x slower?

Hi all.


Left is Rhino 7 , right is Rhino 8. 10x execution time!
curve offset slow.gh (8.9 KB)

I see the Rhino 7 offset sometime failed and the new one not, that’s good.

… but in attached cases those are simple flat polylines.
Skipping rectangular array and flip matrix, Rhino 7, 5ms:


Rhino 8, 49ms:
2024-09-27 23_28_36-Window

… that’s the difference from a realtime execution and a stuttering execution.

Those are 31 trivial polylines.

Something is not right…?

2 Likes

I noticed the same, never able to debug why and ignored it since. Switched to Clipper for this single operation, for what it’s worth. Also faster

As far as I remember, Clipper do not create arcs. This is a rounded offset.


@Gijs can I tag you?

If I use a simple c# script to call the rhinocommon method:

  private void RunScript(Curve C, double D, ref object O)
  {
    O = C.Offset(Plane.WorldXY, D, this.RhinoDocument.ModelAbsoluteTolerance, CurveOffsetCornerStyle.Round);
  }

I get the same results: rhino 8 is 10x slower than rhino 7.

So this shouldn’t be a problem of grasshopper per se, but it’s about something deeper.

Offset has been rewritten in Rhino 8 to become more reliable. Maybe @Joshua_Kennedy can comment if the behavior you are experiencing is expected or not. Do you get the same factor 10 when performing a larger set of curves? (Not behind a pc right now to test this)

I did not notice this before, I’ll try to look this in detail on my next works.

I was creating an example file for kangaroo in the italian discourse, and I noticed offset produced glitchy results in Rhino 7.
Realtime kangaroo returned triangles, round offset sometime failed, but it was hard to pin-point the iterations where the bug occured
curve offset bug.gh (4.0 KB)
Rhino 7:
2024-09-29 12_15_12-Window

Rhino 8:
2024-09-29 12_14_53-Window

When I tried Rhino 8, I was glad to find the problem is already fixed. Offset curve is working better!

Cool! … but it is also way slower.

I instantly noticed because kangaroo were stuttering a lot over a bunch of geometries…

I’m looking into improving the speed of offset now. The issue is open here.

5 Likes

can you give some insights on how the offset - algorithm in Rhino 8 works?

RH-84100 is fixed in Rhino 8 Service Release 14 Release Candidate

1 Like

Generation of the offset curve remains the same as previous versions of Rhino. What’s been implemented is a new trimming algorithm to remove self intersections in the generated offset curve. We use the method described in Polygon Offsetting by Computing Winding Numbers.

2 Likes