You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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);
The text was updated successfully, but these errors were encountered:
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);
The text was updated successfully, but these errors were encountered: