How to change the object type from Brep into NurbsSurface?

Dear Forum Users,

I draw a surface using the button “Surface from 3 or 4 corner points” in Rhino v8. Then I get the ObjectType by using a standalone C# console project utilizing the below code as:

     string str2 = "C:\\Users\\SAMSUNG\\Desktop\\C#-Rhino\\Case3yeni4.3dm";
     File3dm file3dm = File3dm.Read(str2);
     File3dmObjectTable ObjTab = file3dm.Objects;

                    foreach (File3dmObject item in ObjTab)
                    {
                        if (item.Geometry.ObjectType == ObjectType.NurbsSurface)
                       {
                               // Methods to do

                       }

                    }

I get the ObjectType of the surface I have created in Rhino v8 as Brep. Why is it called as Brep; it is just a plane surface defined by four corner points ? If it is Brep, how could I convert a Brep into NURBSSurface since the below code for conversion

NurbsSurface splitsrf = (NurbsSurface)item.Geometry;

does not work.

Best Regards,
Ahmet

Hi @Kazim_Ahmet_Hasim1,

All surfaces and polysurfaces, whether trimmed or untrimmed, are stored in .3dm file as Breps.

Does this help?

– Dale

1 Like