Skip to content
13 changes: 9 additions & 4 deletions CSG/CSGImport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,17 @@ CSGPrim* CSGImport::importPrim(int primIdx, const snode& node )
sn::GetLVNodesComplete(nds, lvid); // many nullptr in unbalanced deep complete binary trees
int bn = nds.size(); // binary nodes

// 2. count total subs for any listnodes of this lvid
// Check if binary tree blows up and warn user
LOG_IF(warning, bn > 100000)
<< "Too many nodes in binary tree (more than a 100 000) built by Opticks. Likely a nested "
"subtraction/union solid that Opticks turns into a full binary tree. Check your geometry as "
"described in: https://github.com/BNLNPPS/esi-g4ox/issues/127";

std::vector<const sn*> lns ;
sn::GetLVListnodes( lns, lvid );
int num_sub_total = sn::GetChildTotal( lns );
// 2. count total subs for any listnodes of this lvid

std::vector<const sn *> lns;
sn::GetLVListnodes(lns, lvid);
int num_sub_total = sn::GetChildTotal(lns);
Comment on lines +320 to +322
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated lines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, fixed in cae45e4

int ln = lns.size();
bool ln_expect = ln == 0 || ln == 1 ;

Expand Down