RhinoOffsetCurve input not clear




I am using the Rhino .NET currently and for the RhinoOffsetCurve method, I am required to give the following input:

  • input Curve
  • offset distance
  • direction point
  • normal
  • corner style
  • tolerance

output : list of curves.

The input curve in my case is always closed, I just wanted to clarify

  • how far does the direction point need to be outside the curve (Since I am expanding the curve)
  • Does the normal denote the normal to the plane on which the curve lies?

With my current choice of direction point I do not get complete offset curves as can be seen in the example below:

Could any one suggest a good way to compute the direction point.


(Dale Fugier) #2

Just to clarify, are you using RhinoCommon or Rhino .NET (e.g. Rhino_DotNet)?


Hi Dale,

I am using Rhino .NET currently.

Best regards,

(Dale Fugier) #4

Hi Sunayana,

Just curious, why have you not switched to RhionCommon? We are no longer working on Rhino .NET, and haven’t since Rhino 4…

But to your questions:

Direction Point is just a point that indicates the direction of the offset.

Normal is a vector that indicates the normal of the plane in which the offset will occur.

Does this help?

– Dale


Hi Dale,

Actually it was about eight months ago that I started working with Rhino and all the code in my current company has been developed using Rhino .NET. So I inherited the code. The code is written in C++/CLI.

So I have been thinking would it be better to switch to RhinoCommon with C++/CLI or just move to the Rhino 6 C++ SDK. Personally if I would prefer to rewrite the existing code using Rhino 6 C++ SDK.
It would be great to know your opinion on this.

As far as the offset goes, from your explanation I understood the RhinoOffsetCurveMethod correctly, but still I do not get expected results. I will try to implement it using the RhinoCommon method and get back to you.

Thank you very much


(Dale Fugier) #6

If you’re willing to start over, I’d probably steer you more towards using C# instead of C++, unless you have some other reason for using C++. Plug-in written in C# will easily port to Rhino for Mac, and the UI tools are much richer. In fact in V6, we have a cross platform UI toolkit, Eto, included with Rhino.

– Dale


Hi Dale,

Thank you very much for your input.
In the mean while I believe that there is a problem with a curve offset method in RhinoCommon as well as Rhino.NET library. I took the following steps:

1.Slice a mesh with planes all of which are parallel to each other
2.The intersection of the planes with the given mesh produces closed planar curves.
3.When trying to offset these curves with an offset distance of 10mm towards outside, the curve offset method does not behave uniformly.
a. In some cases it does not produce any offset
b.In others it produces an open curve

I have used the following RhinoCommon method for the files:
Would you be able to suggest a workaround.
AFO_CDa-coarse_Remeshed.stl (5.9 MB)
pipeOffset.3dm (12.4 MB)

(Dale Fugier) #8

Can you provide some sample source code that is not working for you - something that we can run?


Hi Dale,

I am travelling and currently do not have access to the code, I will get back to you Thursday next week.



Here is the code using the rhinocommon library. I find with my experiments that offset curves are not always created correctly for any cutting plane given a mesh

void GenerateOffsetCurves(Rhino::Geometry::Mesh^ mesh, 
                                     Rhino::Geometry::Plane cuttingPlane,
                                     System::Double offsetDistance,
                                     cli::array<Rhino::Geometry::Curve^>^% offsetCurves)
  cli::array<Rhino::Geometry::Curve^>^ contourCurves = nullptr;
  contourCurves = Rhino::Geometry::Mesh::CreateContourCurves(mesh, cuttingPlane);
  if (contourCurves->Length > 0)
     for(System::Int32 ccIndex = 0; ccIndex < contourCurves->Length; ++ccIndex)
        Rhino::Geometry::Curve^ contourCurve = contourCurves[ccIndex];
        if (contourCurve->IsClosed)
           Rhino::Geometry::CurveOrientation ccOrientation = contourCurve->ClosedCurveOrientation ( cuttingPlane );
           if (ccOrientation == Rhino::Geometry::CurveOrientation::Clockwise)
              offsetCurves = contourCurve->Offset ( cuttingPlane, offsetDistance, 1.0e-4, Rhino::Geometry::CurveOffsetCornerStyle::Round );
          else if (ccOrientation == Rhino::Geometry::CurveOrientation::CounterClockwise)
             offsetCurves = contourCurve->Offset ( cuttingPlane, -toolRadius, 1.0e-4, Rhino::Geometry::CurveOffsetCornerStyle::Round );
return ;

The array of contourCurves usually has length 1 and generally the curve is closed. However, the offsetting does not work all the time. It would be great if you could tell me a way to solve this problem.


(Dale Fugier) #13

I would need to see the input mesh and the parameters used to contour…

I’ll also add that there are known issues with Rhino’s mesh intersector.

– Dale