Why does Offset Srf create weird control points?

Hi people,

I have been using this command recently and I noticed that control points for offseted surfaces look like this?

Although not confirmed, this might be creating some issues on other software such as Revit.

I could Rebuild the surface, but not ideal. Any other solutions to have control points be uniform?

What is the problem with the resulting surface control points? Do you want them to be the same as the base surface? Then offset with “Loose=Yes”.

1 Like

Basically that the control points don’t coincide with the isocurves.

Loose options works!
Sadly for some reason its not available for the method?

To make a loose offset, use 0.0 as the tolerance.
OffsetLoose

private void RunScript(Surface srf, double d, bool loose, ref object A)
{
  A = srf.Offset(d, loose ? 0.0 : RhinoDocument.ModelAbsoluteTolerance);
}

OffsetLoose.gh (7.9 KB)

1 Like

1 Like

Thanks @Mahdiyar. I am having issues implementing it on my side? The offset needs to create a solid but when tolerance is set to 0,0 the result is null.


Offset Solid.gh (105.2 KB)

private void RunScript(Brep brep, double distance, bool solid, bool extend, bool loose, ref object A)
{
if (null != brep)
{
Brep out_blends = null;
Brep out_walls = null;
Brep out_breps = Brep.CreateOffsetBrep(brep, distance, solid, extend, loose ? 0.0 : RhinoDocument.ModelAbsoluteTolerance, out out_blends, out out_walls);
if (null != out_breps)
A = out_breps;
}
}

//

// </Custom additional code>
}

You can use Brep.CreateFromOffsetFace Method instead.

private void RunScript(Brep brep, double distance, bool solid, bool loose, ref object A)
{
  A = Brep.CreateFromOffsetFace(brep.Faces[0], distance, loose ? 0.0 : RhinoDocument.ModelAbsoluteTolerance, false, solid);
}

Offset Solid.gh (100.7 KB)

1 Like

Remove the multi-knots from the surface and the extra control points will vanish. The surface will change shape. For some shapes the change will be very small. For others it may be significant. In Rhino use the command RemoveMultiKnot I don’t know what the equivalent is in RhinoCommon.

In general the exact offset of a NURBS curve or surface cannot be represented by a NURBS curve or surface. Rhino adds knots and/or multi-knots to create a NURBS offset which is within the requested tolerance of the exact non-NURBS offset. Loose=Yes over rides the addition of knots and/or multi-knots.

2 Likes

Good to know! Thanks for the theory behind, always interesting to know how Rhino is actually handling things.

I often prefer to use the overlooked “MoveUVN” tool as a replacement to the loose offset. Check out the following video to see how the loose offset fails at the 14th minute. I purposely did that, in order to show the messy results that sometimes happen with loose offset. Then, I used an alternative method with the “MoveUVN” tool by offsetting the control points instead. Note that at the 14:22 mark I wrote the exact number of the desired offset, then I moved the “N” slider to the end (moving it just partially will result in a shorter offset). Of course, this is not an exact offset and there is always some amount of deviation, however, in many cases that particular trick performs much better than the “Offset” tool with “Loose” option.