Exporting to an IGES file ?


I have a problem with OpenCascade's export routines. How can I translate my GeomAPI_PointsToBSplineSurface to IGES entities?



Roman Lygin's picture

Dear Damir,

In fact, GeomAPI_PointsToBSplineSurface is not an object representing a surface of Open CASCADE. For that, descendants of Geom_Surface are intended. GeomAPI_PointsToBSplineSurface is rather an algorithmic tool that constructs a surface from a grid of points. Resulting surface (which is of the type Geom_BSplineSurface) is returned by method GeomAPI_PointsToBSplineSurface::Surface. Nonetheless, this method serves also as type cast to Geom_BSplineSurface.

To export that resulting surface to an IGES, you can use method IGESControlStd_Writer::AddGeom. For details how to create and correctly initialize object IGESControlStd_Writer, please refer to relevant documentation and samples.

Best regards, Roman

damir jaksic's picture

Hello Roman,

Thank you very much for jour help at my problem about IGES file. During the last 4 days I tried to exporting an IGES file, but it was resultless. I am new at CAS.CADE and one example would help me by understanding details how to writing an IGES file. My code is:


Handle (Geom_BSplineSurface) BS = GeomAPI_PointsToBSplineSurface (array12,3,8, GeomAbs_C2,0.1);

TopoDS_Shape S1 = BRepBuilderAPI_MakeFace(BS);

Handle (AIS_Shape)Face = new AIS_Shape(S1);


//Exporting to an IGES file

IGESControlStd_Writer writer;

IGESControlStd_Writer :: AddGeom;

Interface_Static::CVal ("XSTEP.iges.unit");

Standard_Boolean ok = writer.AddShape(S1);

Standard_Boolean ok = writer.Write ("S1.igs");

Best regards, Damir.