Skip to content

Commit

Permalink
when sizing field is smaller than min_size, return min_size!
Browse files Browse the repository at this point in the history
  • Loading branch information
janetournois committed Nov 26, 2024
1 parent 5a71737 commit 7e1f24e
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,33 +455,16 @@ class Protect_edges_sizing_field
// negative value (marker for special balls).
if(dim < 0)
dim = -1 - dim;

const FT s = field(p, dim, index);
if(s < minimal_size_)
{
std::stringstream msg;
msg.precision(17);
msg << "Error: the field is smaller than minimal size ("
<< minimal_size_ << ") at ";
if(dim == 0) msg << "corner (";
else msg << "point (";
msg << p << ")";
#if CGAL_MESH_3_PROTECTION_DEBUG & 4
CGAL_error_msg(([this, str = msg.str()](){
dump_c3t3(this->c3t3_, "dump-bug");
return str.c_str();
}()));
#else // not CGAL_MESH_3_PROTECTION_DEBUG & 4
CGAL_error_msg(msg.str().c_str());
#endif
}
return s;
else
return field(p, dim, index);
}

/// Query the sizing field and return its value at the point `p`
FT query_size(const Bare_point& p, int dim, const Index& index) const
{
FT s = query_field(p, dim, index, size_);
if (use_minimal_size() && s < minimal_size_)
return minimal_size_;
return s;
}

Expand Down

0 comments on commit 7e1f24e

Please sign in to comment.