I am testing "opencascade-7.0.0-vc12-64" for large models. As a test I extrude a closed polygonal face with 24 vertices using the BRepPrimAPI_MakePrism class. Creating and displaying 24000 translated version of the same entity takes about 14 minutes and the program uses about 5.5GB of memory. With another geometric kernel it only takes about 13 seconds and 1 GB of memory to create and display exactly the same 3D model.
The code to create a single solid object is below. I call it in a loop for a lattice of nonoverlapping 3D positions. I wrote the code based on the samples in the package and in this forum. I need some help on creating the model in a faster way.
void CreateBeam(const std::vector<FPoint2d> &points, double x, double y, double z, double thickness, COcDocument &ocDocument)
for (size_t i = 0; i < points.size(); ++i)
polygon.Add(gp_Pnt(points[i].x, points[i].y, 0));
TopoDS_Wire wire = polygon.Wire();
TopoDS_Face face = BRepBuilderAPI_MakeFace(wire, Standard_True);
TopoDS_Shape shape = BRepPrimAPI_MakePrism(face, gp_Vec(0, 0, 1 * thickness), Standard_False, Standard_False);
trans.SetTranslationPart(gp_Vec(x, y, z));
Handle(AIS_Shape) ais1 = new AIS_Shape(shape);