[Vb.NET] FilletEdge

Oke I removed the whole post. Got a simpler question now:

I got 2 codes.

1 works, the other don’t. why?

The working one:

  Protected Overrides Function RunCommand(ByVal doc As RhinoDoc, ByVal mode As RunMode) As Result

            Dim Int1 As New Interval(0, 10)
            Dim Srf1 As New Geometry.PlaneSurface(New Geometry.Plane(New Point3d(0, 0, 0), New Vector3d(1, 0, 0)), Int1, Int1)
            Dim Srf2 As New Geometry.PlaneSurface(New Geometry.Plane(New Point3d(0, 0, 0), New Vector3d(0, 1, 0)), Int1, Int1)

            Dim SrfToBrep As Geometry.Brep = Srf1.ToBrep
            Dim SrfToBrep2 As Geometry.Brep = Srf2.ToBrep

            Dim newSrf() As Geometry.Surface = Geometry.Surface.CreateRollingBallFillet(SrfToBrep.Surfaces(0), SrfToBrep2.Surfaces(0), 1, 0.01)

            MsgBox(newSrf.Length)

            For Each srf In newSrf
                doc.Objects.AddSurface(srf)
            Next

            doc.Views.Redraw()

            Return Result.Success
        End Function

The failing one:

        Protected Overrides Function RunCommand(ByVal doc As RhinoDoc, ByVal mode As RunMode) As Result

            Dim BBPT2 As Rhino.DocObjects.ObjRef() = Nothing
            Dim BBPT_Result2 As Rhino.Commands.Result = Rhino.Input.RhinoGet.GetMultipleObjects("Select 2 surfaces", False, DocObjects.ObjectType.Brep, BBPT2)
            If BBPT_Result2 <> Rhino.Commands.Result.Success Then
                Return Result.Cancel
            End If

            Dim SrfToBrep As Geometry.Brep = BBPT2(0).Brep
            Dim SrfToBrep2 As Geometry.Brep = BBPT2(1).Brep


            Dim newSrf() As Geometry.Surface = Geometry.Surface.CreateRollingBallFillet(SrfToBrep.Surfaces(0), SrfToBrep2.Surfaces(0), 1, 0.01)

            For Each srf In newSrf
                doc.Objects.AddSurface(srf)
            Next

            doc.Views.Redraw()

            Return Result.Success
        End Function

What I do for the 2nd code is create a box. Explode it. and pick 2 connecting surfaces… nothing happens…

P.S. Somehow. Code 2 works “sometimes” I guess… but cant figure out why…

Unless you are creating the surfaces yourself (and know where the fillet surfaces is supposed to go), you really should be using the version of CreateRollingBallFillet that requries 2d parameter space points, on the surface, near where the fillet is expected to hit the surface.

Do you have an example for me?

Thanks

How can I determine what corner is what point2d?

Here is an example that might help you.

https://github.com/dalefugier/SampleCsCommands/blob/master/SampleCsFilletSrf.cs

The example is really interesting. How can I trim or extend the surface (as in the FilletSrf command)? Is there some example of that in the .NET SDK?