@@ -118,32 +118,6 @@ generate_mesh(
118118 return ;
119119}
120120
121- // same but with sizing field in cell_size
122- // It'd be nice if we could replace this clumsy class by a simple function wrapper (like
123- // domain), but CGAL expects the type FT to be present. :(
124- // https://github.com/CGAL/cgal/issues/4146
125- class Sizing_field_wrapper
126- {
127- public:
128- typedef K::FT FT;
129-
130- Sizing_field_wrapper (const std::shared_ptr<pygalmesh::SizingFieldBase> & cell_size):
131- cell_size_ (cell_size)
132- {
133- }
134-
135- virtual ~Sizing_field_wrapper () = default ;
136-
137- K::FT operator ()(const K::Point_3& p, const int , const Mesh_domain::Index&) const
138- {
139- auto out = cell_size_->eval ({p.x (), p.y (), p.z ()});
140- return out;
141- }
142-
143- private:
144- const std::shared_ptr<pygalmesh::SizingFieldBase> & cell_size_;
145- };
146-
147121void
148122generate_with_sizing_field (
149123 const std::shared_ptr<pygalmesh::DomainBase> & domain,
@@ -193,7 +167,9 @@ generate_with_sizing_field(
193167 std::cerr.setstate (std::ios_base::failbit);
194168 }
195169 if (cell_size) {
196- Sizing_field_wrapper size (cell_size);
170+ const auto size = [&](K::Point_3 p, const int , const Mesh_domain::Index&) {
171+ return cell_size->eval ({p.x (), p.y (), p.z ()});
172+ };
197173 auto criteria = Mesh_criteria (
198174 CGAL::parameters::edge_size=edge_size,
199175 CGAL::parameters::facet_angle=facet_angle,
0 commit comments