Dear Users,
I tried to use the method sup(ic) to remove some convexes from a mesh region but it seems to do nothing. Maybe I am missing something...
Would you kindly have a look to the following very simple code?
// Add all convex to the region
for (dal::bv_visitor cv(mymesh.convex_index()); !cv.finished(); ++cv)
mymesh.region(1000).add(cv);
cout << "Region 1000 contains "
<< mymesh.region(1000).index().size()
<< " convexes" << endl;
bgeot::base_node point(0.0, 0.5, 0.5);
for (size_type j=0; j<length; ++j){
// Find the global idx of point
size_type pidx = 0;
bool found = false;
while (pidx < mymesh.points().size() && !found){
if (fabs(mymesh.points()[pidx][0] - point[0]) < 1E-6 &&
fabs(mymesh.points()[pidx][1] - point[1]) < 1E-6 &&
fabs(mymesh.points()[pidx][2] - point[2]) < 1E-6)
found = true;
else
pidx++;
}
GMM_ASSERT1(pidx < mymesh.points().size(),
"error: point not found");
// Remove all convexes to the point
for (auto cv : mymesh.convex_to_point(pidx))
mymesh.region(1000).sup(cv); // ? //
// Update the point
point[0] += 1.0/length;
}
cout << "Region 1000 contains "
<< mymesh.region(1000).index().size()
<< " convexes" << endl;
The aim is to build a region with a hole from (0.0,0.5,0.5) to (1.0,0.5,0.5). Unexpectedly, the number of convexes within the region after the manipulation does not change.
Thank you,
Domenico