Skip to content

Rendering of large number of objects #26

@csb2024

Description

@csb2024

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions