type of surface and related information

Hi
If I have a surface (Geom_Surface), how I can get the type of this surface. For example, planar, cylindrical, spherical, bspline, etc?
And once I have the surface type, how I can get the information about this surface? For example, if it's a cylindrical surface, how to get the axis and the radius, etc?

Thanks in advance.

Sean

Gabriel Bauer's picture

Try the method GetType from GeomAdaptor_Surface.
There you can use the method Cylinder to create a gp_Cylinder and then get the Radius.

Gabriel Bauer's picture

Like this:

GeomAdaptor_Surface adapt( surface );
if ( adapt.GetType() == GeomAbs_Cylinder )
{
gp_Cylinder cyl = adapt.Cylinder();
Standard_Real radius = cyl.Radius();
}

seanliu's picture

Hi Gabriel:
Thank you so much for your help.

Sean