Create a Solid by offsetting a surface using rhino Common and C#

Hi,

Is it possible to create a solid from a surface by offsetting it using Rhino Common and C#.

Yes.

Import your surface as Brep, so the first face of the brep is the surface itself.

private void RunScript(Brep S, double D, ref object A)
  {
    double t = this.RhinoDocument.ModelAbsoluteTolerance;
    A = Rhino.Geometry.Brep.CreateFromOffsetFace(S.Faces[0], D, t, false, true);
  }
1 Like

Thank you @maje90 , I haven’t used the .Faces[ ] that’s where I went wrong.