"True" split of surface into new surfaces

I am using Rhino to generate hull surfaces. (they are actually for wave energy converters, but it is similar to a ship hull). I need to create the entire hull surface (portion above and below the water line, where the waterline can be represented as a plane), then I need to delete the portion above the waterline, and just export the portion below the waterline.

It is the same conceptually as what this person was doing: Splitting a surface using rhinoscript and deleting upper surface

EXCEPT, I want to export Nurbs surfaces not a Mesh (the poster above was exporting a mesh). (_SaveAs name.gdf)

The program that I (and the poster mentioned above) are using is called WAMIT and it solves the hydrodynamics of a submerged hull. It can take a mesh, or a Nurbs surface as a series of Nurbs panels. The solution with a Nurbs is much faster and more accurate.

However, WAMIT can’t handle Rhino trimmed surfaces. If a surface is trimmed (as with the Split or Trim commands), the _SaveAs name.gdf command exports the underlying surface, not just the trimmed surface.

Is there a way, or a plug-in, or a recommended way to write a plug-in (I’m already writing a plug-in) to make a “true” split of a Nurbs surface and create two new Nurbs surfaces (Brep.IsSurface = true)?

shrinktrimmedsrf

Thanks! Is there a Rhinocommon way to do ShrinkTrimmedSrf (other than call the command) that I put in my Plug-in?

Unfortunately, ShrinkTrimmedSrf will not, generally, do this, unless there is a control point line that exactly intersects the water line.

Then you could call, ShrinkFaces on the Faces collection of the BRep.
http://4.rhino3d.com/5/rhinocommon/html/M_Rhino_Geometry_Collections_BrepFaceList_ShrinkFaces.htm

The only way to do this is to use a surface that only describes the hull under water, that is, all the control points of one of the four sides lie on the water line plane.

Thanks menno.

Is there a way to add a new control point line to my Nurbs surface at the intersection of the the surface and the water plane (or create a new Nurbs surface with the same geometry and extra control points)?

like interpolate between my existing control points to find new control points at the waterline that would not affect the surface shape?

and then call ShrinkFaces

No, this is up to the user; you can’t do this programatically.

Anytime you try to do an analysis directly with NURBS surfaces, you run into this trimming problem. Consequently there has been a lot of research conducted to deal with it. In the past, I have busted the surface into Beziers and then dealt with the trims on the individual panels. I would suggest that you begin with a paper entitled “Exact and Approximate Representations of Trimmed Surfaces with NURBS and Bezier Surfaces” by Xin Li and Falai Chen. Since you have a very simple trimming situation, a flat plane, you may be able to use one of the older and simpler methods also referenced in this paper.