Surface.CreateExtrusion

In RhinoCommon, in the Surface class, we have:

Rhino.Geometry.Surface.CreateExtrusion(curve, vec)

Which creates a “surface” in the form of an extrusion of the curve along a vector.

However, unless the curve in question has no discontinuities, this will create a multi-face Brep (polysurface) or an Extrusion object. Shouldn’t this method be in the Brep and/or Extrusion classes as well? This is the only method I found to create an extrusion along a specific direction. What am I missing here? (probably something blindingly dumb…)

Thanks,
–Mitch

It depends on how you add the surface to the document and the setting of CreaseSplitting.
If CreaseSplitting=Yes, you can still add it as a single surface using the following:

Surface extruded = Surface.CreateExtrusion(curve, vec); // this is a single surface
Brep b = extruded.ToBrep(); 
doc.Objects.AddBrep(b); // this will split along creases and create a multi-facet brep
doc.Objects.AddBrep(b, null, null, false, false); // this will not split creases

see http://4.rhino3d.com/5/rhinocommon/html/M_Rhino_DocObjects_Tables_ObjectTable_AddBrep_3.htm

Hi Menno,

My point was simply that this method should also be included in the Brep and Extrusion classes for clarity and convenience.

Cheers, --Mitch