Create mesh is very slowly

I've some problem with creating meshes.

I need to create big number of Box mesh (appx: 1000000).
For create I use following code:
BRepPrimAPI_MakeBox _cube(gp_Pnt(i*size,j*size,k*size), 100, 100, 100);
TopoDS_Shape cube = _cube.Shape();

Handle(AIS_Shape) AISCube=new AIS_Shape(cube);
myContext->SetMaterial(AISCube, Graphic3d_NOM_GOLD);
myContext->SetDisplayMode(AISCube, AIS_Shaded, Standard_True);
myContext->Display(AISCube, Standard_False);

Meshes is creating very slowly.

Please ask me - How I can increase speed of creating meshes?

Patrik Mueller's picture

Hi,

can you group the boxes to a TopoDS_Compound?

valerii76's picture

Thank for you answer.

Sorry I start programming with using OpenCasCade recently. Can you tell me, what about TopoDS_Compound? Or give me URL when I can read about it.

Patrik Mueller's picture

Hi,

it is something like a group. Take a look here:

http://www.opencascade.org/org/forum/thread_11970/

valerii76's picture

Ok. Thank you.

I'll try it.