Offset bug

I’ve got a curve which is acting strange when using the offset command on it:

When I try to offset the curve by 1 mm and click on any of the red points to decide which direction to offset, I get this as a result:

When I offset by clicking on any of the green points here to decide which direction to offset I get this as a result, which is correct:

Looks like a bug to me. Is there anything I can do without changing the shape so that it always works for offsetting? I tried SimplifyCrv, Move to origin and Explode & Join.
This offset process is part of a grasshopper definition so I’d like to be able to fix issues like these (using clipper wouldn’t work)

200316 Offset bug.3dm (35.9 KB)

Well, I don’t think you will be able to make it automatically foolproof - Rhino’s Offset is classically unreliable with these types of forms. In this case, because you have joined lines and arcs, making it a degree 2 polycurve, plus those two small jogs in the middle of your “V” sides, plus perhaps the fact that the curve seam starts at one of the arc segments, it is a cocktail for disaster.

Offsets of less than the ‘jog’ of 1mm seem to work fine.

With manual testing, I find that moving the curve seam away from one of the arc segments to any corner where there are just two line segments also makes the offset work. So it might be possible to concoct a script running inside a script component in GH that will offset, check the result, if it is bad, move the curve seam, offset again etc. until it is OK… maybe. But that may not work for other curves.

Another thing that you could try in this case is extrude the curve, OffsetSrf the extrusion and then extract the offset border… that seems to work in normal Rhino here. Edit, ah, crap, you can’t offset a multiface brep in standard GH… only a single surface.

Edit 2:

OK, this seems to work - with at least with your curve:

  1. Offset Loose - reliable, but makes a self-intersecting curve
  2. Boundary Surface
  3. BrepEdges
  4. Join (En)

OLoose.gh (5.0 KB)

Edit 3: On closer inspection, it doesn’t work all that well on the uppermost arcs, which are multispan. Offset Loose offsets the control points, whereas Offset should have offset the arc exactly plus added some straight segments. So those offset arcs are actually no longer arcs, they are degree 2 splines and the offset distance is not correct in that area. :confounded:

Edit 4… Well, I should have tested your original premise first - with the GH standard offset component, I am getting a correct offset - better than Rhino native. Hmmm…

ONormal.gh (4.8 KB)

Hi @Helvetosaur, thanks a lot for your checking and helping finding a solution.

Yeah we noticed this, but the position of the curve seam is what gets decided before geometry gets linked to grasshopper and is a bit important. (grasshopper definition for creating machine code so seam determines lead-in and lead-out). I now let the definition create a pop-up warning showing there’s an error in the offset with that curve so the seam can be manually tweaked, but ideally it would solve these cases, especially since it manages correctly in some spots and not the others.

I guess that’s because I have the corners set to sharp (just like the default in the offset command), sorry for not mentioning that.

Anyway, I guess I also posted it here so somebody from Mcneel can use this as a reference to improve the code for offsetting.

The default GH also uses “sharp”…

Let’s hope. Been posting offset fail examples like this one here for a long time (as have others…).

Hey guys - I’ve put this on the list as RH-57454.
Takker,
-wim