For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Application crashes when declaring IGES_ControlWriter Object

Anand R P's picture

I used this code snippet to draw a pipe and write to an igs file..But the application crashes on runtime on reaching this line "IGESControl_Writer writer;". I dont know what to do. Please help

TColgp_Array1OfPnt array1 (1,5); // sizing array
array1.SetValue(1,gp_Pnt (0,0,0 ));
array1.SetValue(2,gp_Pnt (0,257,0 ));
array1.SetValue(3,gp_Pnt (296,257,0 ));
array1.SetValue(4,gp_Pnt (296,169,0));
array1.SetValue(5,gp_Pnt (415,200,0));

double rad = 10;

Handle(Geom_Curve) curve = GeomAPI_PointsToBSpline(array1).Curve();
TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(curve);
TopoDS_Wire spine = BRepBuilderAPI_MakeWire( edge );

// define profile shape
gp_Pnt origin;
gp_Vec normal;
curve->D1(curve->FirstParameter(), origin, normal);
gp_Dir v1 = gp::DX().IsParallel(normal, Precision::Angular()) ? gp::DY() : gp::DX();
gp_Ax2 center(origin, normal, v1);

Handle(Geom_Curve) circle = new Geom_Circle(center, rad);
TopoDS_Edge circleEdge = BRepBuilderAPI_MakeEdge(circle);
TopoDS_Wire circleWire = BRepBuilderAPI_MakeWire(circleEdge);
TopoDS_Face profile = BRepBuilderAPI_MakeFace(circleWire, Standard_True);

// pipe profile algong spine
BRepOffsetAPI_MakePipe makePipe(spine, profile);
TopoDS_Shape shape1 = makePipe.Shape();

IGESControl_Writer writer;
TopExp_Explorer Ex;
for (Ex.Init(shape1,TopAbs_SHELL); Ex.More(); Ex.Next())
writer.AddShape( Ex.Current() );

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.