Performance Problem

Hello,

I have a problem with the performance. I create 60 shapes in this way:
TopoDS_Shape DrawDemo::getBRepOffsetAPI_MakePipe_Ply(int X, int Y)
{
int offsetX=X*10;
int offsetY=Y*1;
gp_Pnt aPntNW(-3+offsetX, 0, 0.5+offsetY);
gp_Pnt aPntNO(3+offsetX, 0, 0.5+offsetY);
gp_Pnt aPntSO(3+offsetX, 0, -0.5+offsetY);
gp_Pnt aPntSW(-3+offsetX, 0, -0.5+offsetY);

gp_Pnt aPathp1(10+offsetX,0,0+offsetY);
gp_Pnt aPathp2(0+offsetX,60,0+offsetY);
gp_Pnt aPathp3(10+offsetX,100,0+offsetY);
gp_Pnt aPathp4(0+offsetX,150,0+offsetY);

Handle(TColgp_HArray1OfPnt) pathArray =new TColgp_HArray1OfPnt(1,4);
pathArray->SetValue(1,aPathp1);
pathArray->SetValue(2,aPathp2);
pathArray->SetValue(3,aPathp3);
pathArray->SetValue(4,aPathp4);

Handle(Geom_TrimmedCurve) aSegmentN = GC_MakeSegment(aPntNW , aPntNO);
Handle(Geom_TrimmedCurve) aSegmentO = GC_MakeSegment(aPntNO , aPntSO);
Handle(Geom_TrimmedCurve) aSegmentS = GC_MakeSegment(aPntSO , aPntSW);
Handle(Geom_TrimmedCurve) aSegmentW = GC_MakeSegment(aPntSW , aPntNW);

TopoDS_Edge aEdgeN = BRepBuilderAPI_MakeEdge(aSegmentN);
TopoDS_Edge aEdgeO = BRepBuilderAPI_MakeEdge(aSegmentO);
TopoDS_Edge aEdgeS = BRepBuilderAPI_MakeEdge(aSegmentS);
TopoDS_Edge aEdgeW = BRepBuilderAPI_MakeEdge(aSegmentW);

TopoDS_Wire profile = BRepBuilderAPI_MakeWire(aEdgeN, aEdgeO , aEdgeS, aEdgeW);

Handle(Geom_BSplineCurve) curveSpline = GeomAPI_PointsToBSpline(pathArray->Array1()).Curve();
TopoDS_Edge edgeSpline = BRepBuilderAPI_MakeEdge(curveSpline);

TopoDS_Wire wireSpline = BRepBuilderAPI_MakeWire(edgeSpline);

TopoDS_Shape shape =BRepOffsetAPI_MakePipe(wireSpline,profile);

return shape;
}

The first shapes are build very fast. But in the end the creation of new shapes is very very slow (nearly a minute per shape). Did i use wrong packages?

regards,
Franz

Denis Barbier's picture

Hello, your performance problem comes more likely from the insertion of the created shape into your model.