dtcc-platform / dtcc-builder

MIT License
6 stars 3 forks source link

Simplify bindings #19

Closed anderslogg closed 1 year ago

anderslogg commented 1 year ago

C++ functions are wrapped in two steps. Should be possible to remove the middle step?

Example: Smoother::smooth_volume_mesh

First we have this wrapper:

Mesh3D smooth_volume_mesh(Mesh3D &volume_mesh,
                          const CityModel &city_model,
                          const GridField2D &dem,
                          double top_height,
                          bool fix_buildings,
                          size_t max_iterations,
                          double relative_tolerance)
{
  Smoother::smooth_volume_mesh(volume_mesh, city_model, dem, top_height,
                               fix_buildings, max_iterations,
                               relative_tolerance);
  return volume_mesh;
}

And then we have this binding:

m.def("smooth_volume_mesh", &DTCC_BUILDER::smooth_volume_mesh, "Smooth volume mesh");

Should be possible to remove that wrapper function.

anderslogg commented 1 year ago

Mostly done now. Not perfect but the middle layer has been removed.