Trimming surface using Rhinoscript

I am trying to develop a parametric Offshore platform for hydrodynamic analysis. For this I need a hollow surface model of the underwater hull surface. I need to develop the whole hull form through scripts only so I can use it in automated optimization problem.

This is how the mode looks so far.

I need to trim the square part to make a hole. I have the top surface (Surf_BaseOctagonUS) and the intersecting curve Part2_LowerCurve as objects.

Rhino.Command "-_Trim " & Surf_BaseOctagonUS(0)  & " _Enter " & Part2_LowerCurve(0)   & " _Enter"

But this is not working. After printing the below outputs, its essentially not doing anything.

Appreciate any help to handle such problems.


Hi Tava,

Did you try using RhinScript trim methods instead command version?


I couldn’t find any for the surface. There is only Rhino.TrimCurve option. Am I missing something?

not at my computer now, but there should be TrimSurface and TrimBrep. Check the RS help file index.

See these topics:

Are these function available in Rhino version 4? I am getting error messages as below when I try to execute the following code:

  Rhino.TrimBrep Surf_BaseOctagonUS(0), Part2_LowerCurve(0) 

The links I posted are from the Rhino 5 help file. So see what is available in Rhino 4.0, launch it and then pick Help -> Plug-ins -> RhinoScript.

These are available only in Rhino 5.

Unfortunately I only have version 4, and since the academic license is not free, I must figure out a way to do this in version 4 only at this time.

As a quick fix, I am able to achieve the goal without using the trim function. I used the Rhino.AddPlanarSrf command with surrounding curves that enclose the hole. This gives:

However, later I may need to do similar thing with two intersecting pipes.