From ae8cb4ecdcd083e3c97a940ef49926aa44703e54 Mon Sep 17 00:00:00 2001 From: BenPinet Date: Thu, 13 Aug 2026 12:31:51 +0200 Subject: [PATCH] fix(GeometricalOperationsOnMesh): update template parameter for geometrical operations on mesh --- .../geometrical_operations_on_mesh.cpp | 4 ++-- .../geometrical_operations_on_mesh.hpp | 22 ++++++++----------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/bindings/python/src/mesh/helpers/geometrical_operations_on_mesh.cpp b/bindings/python/src/mesh/helpers/geometrical_operations_on_mesh.cpp index efc907b61..48ce765b0 100644 --- a/bindings/python/src/mesh/helpers/geometrical_operations_on_mesh.cpp +++ b/bindings/python/src/mesh/helpers/geometrical_operations_on_mesh.cpp @@ -43,13 +43,13 @@ const auto translate_name##mesh##dimension = absl::StrCat( \ "translate_", mesh_name, std::to_string( dimension ), "D" ); \ module.def( translate_name##mesh##dimension.c_str(), \ - &translate_mesh< mesh, mesh##Builder, dimension > ) + &translate_mesh< mesh##dimension##D > ) #define PYTHON_RESCALE( mesh, mesh_name, dimension ) \ const auto rescale_name##mesh##dimension = absl::StrCat( \ "rescale_", mesh_name, std::to_string( dimension ), "D" ); \ module.def( rescale_name##mesh##dimension.c_str(), \ - &rescale_mesh< mesh, mesh##Builder, dimension > ) + &rescale_mesh< mesh##dimension##D > ) namespace geode { diff --git a/include/geode/mesh/helpers/geometrical_operations_on_mesh.hpp b/include/geode/mesh/helpers/geometrical_operations_on_mesh.hpp index e81cb564c..1947f9d45 100644 --- a/include/geode/mesh/helpers/geometrical_operations_on_mesh.hpp +++ b/include/geode/mesh/helpers/geometrical_operations_on_mesh.hpp @@ -29,12 +29,10 @@ namespace geode { - template < template < index_t > class Mesh, - template < index_t > class MeshBuilder, - index_t dimension > - void translate_mesh( Mesh< dimension >& mesh, - MeshBuilder< dimension >& builder, - const Vector< dimension >& translation ) + template < class Mesh > + void translate_mesh( Mesh& mesh, + typename Mesh::Builder& builder, + const Vector< Mesh::dim >& translation ) { for( const auto v : Range{ mesh.nb_vertices() } ) { @@ -42,17 +40,15 @@ namespace geode } } - template < template < index_t > class Mesh, - template < index_t > class MeshBuilder, - index_t dimension > - void rescale_mesh( Mesh< dimension >& mesh, - MeshBuilder< dimension >& builder, - const std::array< double, dimension >& scale ) + template < class Mesh > + void rescale_mesh( Mesh& mesh, + typename Mesh::Builder& builder, + const std::array< double, Mesh::dim >& scale ) { for( const auto v : Range{ mesh.nb_vertices() } ) { auto point = mesh.point( v ); - for( const auto d : LRange{ dimension } ) + for( const auto d : LRange{ Mesh::dim } ) { point.set_value( d, point.value( d ) * scale[d] ); }