Offset Curve Bug in GH1 R8

Hi Guys,

Trying to port my Kite design plugin to R8 and have run into a bug in the Offset Curve component.

I set the ‘Corner’ option to 0/NONE and in R7 I get 4 separate offset curves:

The same code in R8 seems to ignore the corner option for NONE and defaults to SHARP:


This completely breaks all the downstream code.

I can’t think of a reasonable way to fix this code and maintain backward compatibly to R7.

Cheers

DK

OK - as sanity check I tried the Rhino OFFSET CURVE command in both R7 and R8 on the same curves with corners set to NONE and got the same result.

R7:

R8:

So looks like a bug in the underlying code - can you please fix this for me?

Thanks

DK

If you set Loose=Yes, it reveals that Rhino 8 just wants to tidy up those corners and is disappointed when it fails to do so:

Trying to find the simplest way to reproduce it, here’s a simple rectangle. Not the same file, I just created rectangles corner to corner in the top view then offset them (only option changed, corner to none in both 7 and 8).

V7: leaves corners open
V8: closes them

It’s hard to imagine this making it through regression testing… maybe it’s a deliberate decision?

I can’t imagine it’s a deliberate decision, as the behavior that is being produced is identical to ‘corners=sharp’

I don’t see any reason why both options should have the same behavior.

Cheers

DK

I’m with you on the bug report, which is why I checked the simple example that I assumed would have automated regression tests in place for every combination of options. We’ll see what they say.

I can confirm the problem in V8.

I wonder if this has to do with the fact that in RhinoCommon, to get no extensions, you have to set the corner style so:

corner_style=Rhino.Geometry.CurveOffsetCornerStyle.None

This works in Python 2 for example but not in Python 3 because None is not allowed - it is reserved.

In Python 3 you need to have this:

corner_style=Rhino.Geometry.CurveOffsetCornerStyle.NONE

(neither one works correctly in GH/V8)

So, although the Offset component is not programmed in Python, I’m wondering if somewhere in there a similar thing is happening…

I created a youtrack item for this so it gets some attention:
https://mcneel.myjetbrains.com/youtrack/issue/RH-78581/In-Grasshopper-1-V8-setting-corner-style-to-0-no-extension-fails-on-polycurves

Thanks, Mitch.

FWIW, Grasshopper merely uses what it gets served, so this is something that needs to be fixed in Rhino. Also FWIW, in Rhino 8, offsetting planar curves uses a completely different algorithm than what it did in Rhino 7. The Rhino 7 code is used in Rhino 8 for non-planar curves. I’ve changed the YT item’s subsystem and assigned it to Joshua.
-wim

1 Like

Yeah, you’re right, I thought I had tested this in base Rhino but I must have been in a V7 without noticing at the time.

Thank @Helvetosaur and @wim I hope someone can get onto this soon.

Cheers

DK

Did you see that on Thanksgiving weekend it’s already got a pull request and is marked for testing?

1 Like

@Nathan_Bossett yet again McNeel impresses me with their response to issues.

Cheers

DK

RH-78581 is fixed in Rhino 8 Service Release 2

1 Like

@brian - thank you, downloading now and will start checking as soon as possible.

Cheers

DK

Hi Guys,

I can report that I have got my plugin running in Version 8 SR2 (8.2.23333.9481, 2023-11-29) Evaluation.

This Offset Curve bug appears to have been fixed. I did find another minor issue related to getting edges from a bounding box but honestly the fix for that makes my code more robust anyway.

I will need to get a few end users onto load testing for me but as soon as SR2 becomes the main evaluation version I will be able to offer a R8 trial.

Thanks

DK