Cfd icon indicating copy to clipboard operation
Cfd copied to clipboard

Rendering of large number of objects

Open csb2024 opened this issue 1 year ago • 0 comments

I want to generate an object with a large number (about 10,000) of spheres with the same characteristics composite, I find that CAD interactions are less efficient, is there a more efficient way to write this? My code is below, thanks a lot! BRep_Builder builder; TopoDS_Compound combinedShape; builder.MakeCompound(combinedShape); try { for (Standard_Integer i = 0; i <= (ring_count.getValue() - 1); i++) { for (Standard_Integer j = 0; j <= (frag_count.getValue() - 1); j++) { TopoDS_Shape sph = BRepPrimAPI_MakeSphere(centers(i, j), frag_radius.getValue()); //spheresList.Append(sph); builder.Add(combinedShape, sph); } } if(combinedShape.IsNull()) return new App::DocumentObjectExecReturn("Resulting shape is null"); this->Shape.setValue(combinedShape);

csb2024 avatar Jun 26 '24 02:06 csb2024