STEP file conversion.

Hi,

i'm looking for the way to convert quatities from "TopoDS_Face" to "Geom_***" in order to use some APIs like "GeomAPI_IntCS" which can't dealing TopoDS quatities.

What function is used for retrieving surface quatities ( radius, surface information, ... ) after reading STEP files in OC.

My trial is

/**********************************************************
STEPControl_Reader reader; // (1)

reader.ReadFile("sphere.stp");

Standard_Integer NbRoots = reader.NbRootsForTransfer();

Standard_Integer NbTrans = reader.TransferRoots();

const TopoDS_Shape shape = reader.Shape();

TopExp_Explorer Ex;

int i=0;

for (Ex.Init(shape,TopAbs_FACE); Ex.More();Ex.Next()) {

i++;

Handle_TopoDS_TShape newHandle = Ex.Current().TShape();
Standard_Transient *newTransient = newHandle.Access();
const Handle_Standard_Transient *newHandleTransient = new Handle_Standard_Transient(newTransient);

TopoDS_Face newFace=TopoDS::Face( Ex.Current() );

Handle(TopoDS_TShape) downcastedPlane = newHandle.DownCast(*newHandleTransient);

// want to use these wokrs finally !!!
// gp_Pnt P1(-5,-5,0);
// gp_Pnt P2(9,9,9);
// Handle(Geom_Curve) aCurve = GC_MakeSegment(P1,P2).Value();
// gp_Pnt P3(3,0,0);
// gp_Pnt P4(3,0,10);
// Standard_Real radius1 = 3;
// Standard_Real radius2 = 2;
// Handle_Geom_Surface aSurface = GC_MakeConicalSurface(P3,P4,radius1,radius2).Value();
// GeomAPI_IntCS CS (aCurve,aSurface);
// Handle(Geom_Curve) segment;

}

**********************************************************/

please anyone let me know informations can help me.

Thanks in advance.

Dennis G.'s picture

Hello Minsu,

you can use:

TopLoc_Location aLoc;
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(newFace, aLoc);

Cheers,

Dennis