-
Notifications
You must be signed in to change notification settings - Fork 42
Description
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);