Clean surface after offset in RhinoScript

Hello everyone,

I am trying to put up a script (Rhinoscript) in order to offset a surface at a specified offset value.
My surface is curved, and because of that, there is a threshold offset value : any specified value above that threshold results in a weird curved offset surface (see image below).

This is quite normal, I don’t think there really is a way around this in the first place (or maybe limiting my original surface to avoid this, but finding the right surface domain corresponding to the offset value sounds like a really complicated task), but I’m struggling to get rid of that reversed surface on the edge.

I’ve tried different things, and one command that I thought could solve my problem is the “Split surface at creases” but somehow it doesnt work. I noticed that this weird surface does not have any sharp edge but it is rather curved, I don’t know if that prevent the “splitatcreases” command from working?

The closest I got to solving my problem was using the draft angle analysis, which was able to detect/delimit the offset surface right at the creases. That way I could manually extract the mesh of the offset surface I was interested in and then rebuild the surface from the mesh using the patch command.
However I need to do this in a script, not manually. I was able to find Rhino.ExtractAnalysisMesh in Rhinoscript, but I did not find the DraftAngleAnalysis script command. So I am unable to complete my script.

Does anyone have any idea on how can this be solved? that would be much appreciated.

I’m afraid I am not able to upload my file, but this same issue can be “simulated” using any simple curved surface with a sufficiently high offset value.

Thank you to anyone who might answer, and sorry for my English
Let me know if something is unclear



Hi @Oznerol,

Can you post a model that contains the surface, rather than just a picture? Also, if you have some sample code that you are using to offset, we’d like to see that too.


– Dale

Hi @dale

Thank you for your answer and please excuse me for the VERY late response.

I am not able to send you my original geometry, but basically any curved surface should do, here is one example in .stp
test.stp (39.9 KB)

About my script, basically all it does is use Rhino.OffsetSurface (well thats not the only thing i’m scripting but the rest is not related to the offset):

Call Main()
Sub Main()
    Dim arrtemp, or_surf, d, of_surf
    arrtemp = Rhino.GetSurfaceObject("Choose surface to offset")
    If IsArray(arrtemp) Then
        or_surf = arrtemp(0)
    End If
    Erase arrtemp
    d = Rhino.GetReal("Enter offset distance")
    of_surf = Rhino.OffsetSurface(or_surf, d)
End sub

Again this is no bug of the script or the offset, considering the surface has weird curvature, it is inevitable. I just wish to know how to limit my surface or get the right surface domain to keep.

As I said in my first post, I thought maybe there was something to be done with the draft angle analysis. Although I have seen another post by @pascal on the matter, where he suggested to use the Silhouette command. I tried it and that might the best I got, although inside a script I am not too sure how to use it.

Finally, I actually found a way around my problem, but still I would be interested to know how such a thing could be solved.

Thank you for your help,



Hi Oznerol -one thing I notice is that your original surface is only tangent continuous in the highly curved area -

So the offset there is likely to be even more squirrely. If you can make the surface more cleanly - I’d say this surface is denser than it needs to be - and curvature continuous, you can’t avoid self-intersection above a certain offset, of course, but it may nonetheless behave better.


testOffseter_PG.3dm (81.4 KB)


Hello @pascal,
Thank you for your answer.

This is something I definitely need to do! Because one of my other issue is that the offset function tends to amplify the defaults of the original surface, and I’m struggling with that.

But creating a fully clean surface is not necessarily easy… So I know how to show the curvature graph on some isocurves of my surface and it shows the same kind of weird thing you posted. Although I am unable to know how to correct it like you did. Did you have to create a brand new curve to fit the old one?

Thank you in advance,



Hi Oznerol - that’s right - in this case it was easy enough to make a new one that is reasonably close to the original but that is not always the case, On your original, you can try RemoveMultiknot and then offset - bit as clean but maybe better.


Hello @pascal,

Thank you very much for your help, please excuse me for the delay between my comments. :upside_down_face:

I’m trying to extract isocurves from the original surface and clean them or at least try to rebuild a smoother surface. Although I did not find a satisfactory result yet.

I also tried the RemoveMultiknot command as you told me to but it seems there is not any.

I believe there is not much I can do given the complexity of my original surface. Although I obtained a more or less satisfactory results by juste cleaning my surfaces manually…
That will do for now.