I am writing a deformation command with Rhinocommon. It takes a surface (or other object) and repositions its control points, and then adds the surface back to the document. The code below doesn’t have any of the repositioning going on, it just gets the control points of a surface, and then immediately tries to recreate the surface. It works for a simple 4 sided surface.
But when I have a surface which has two sides sharing an edge, this presents a problem. I can solve it by not including the start and end points in the right direction (u or v depending on which edge is shared), but tangency at the seam is lost. How might I solve this?
I will also have to make it work with trimmed surfaces. It does some curious things to spheres too…
Perhaps there is a more robust way to gather all info from a surface that can be used to recreate it?
I’ve attached a file with a couple example surfaces to try it on. Surfaces.3dm (251.8 KB)
Dim rhObject As Rhino.DocObjects.ObjRef
Rhino.Input.RhinoGet.GetOneObject(“Select Surface”, True, Rhino.DocObjects.ObjectType.Brep, rhObject)
Dim Brep = TryCast(rhObject.Geometry, Rhino.Geometry.Brep)
Dim NurbsSurface = Brep.Surfaces(0).ToNurbsSurface
Dim NurbsSurfacePoints = New List(Of Rhino.Geometry.Point3d)
Dim srfU = NurbsSurface.Points.CountU
Dim srfV = NurbsSurface.Points.CountV
For u = 0 To srfU - 1
For v = 0 To srfV - 1
Dim NewNurbsSurface = Rhino.Geometry.NurbsSurface.CreateFromPoints(NurbsSurfacePoints, srfU, srfV, 3, 3)