diff --git a/bindings/python/src/mesh/CMakeLists.txt b/bindings/python/src/mesh/CMakeLists.txt index 237e6e8cb..83e6a80d6 100644 --- a/bindings/python/src/mesh/CMakeLists.txt +++ b/bindings/python/src/mesh/CMakeLists.txt @@ -69,6 +69,7 @@ add_geode_python_binding( "helpers/convert_solid_mesh.cpp" "helpers/convert_surface_mesh.cpp" "helpers/crs_helper.cpp" + "helpers/debug.cpp" "helpers/euclidean_distance_transform.cpp" "helpers/geometrical_operations_on_mesh.cpp" "helpers/gradient_computation.cpp" diff --git a/bindings/python/src/mesh/helpers/debug.cpp b/bindings/python/src/mesh/helpers/debug.cpp new file mode 100644 index 000000000..d86d6dab5 --- /dev/null +++ b/bindings/python/src/mesh/helpers/debug.cpp @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2019 - 2025 Geode-solutions + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +#include "../../common.hpp" + +#include +#include +#include + +#include +#include +#include + +namespace geode +{ + void define_debug( pybind11::module& module ) + { + module.def( "save_segment2D", &detail::save_segment< 2 > ) + .def( "save_segment3D", &detail::save_segment< 3 > ) + .def( "save_triangle2D", &detail::save_triangle< 2 > ) + .def( "save_triangle3D", &detail::save_triangle< 3 > ) + .def( "save_triangle2D", &detail::save_triangles< 2 > ) + .def( "save_triangle3D", &detail::save_triangles< 3 > ) + .def( "save_tetrahedron", &detail::save_tetrahedron ) + .def( "save_tetrahedra", &detail::save_tetrahedra ); + } +} // namespace geode diff --git a/bindings/python/src/mesh/mesh.cpp b/bindings/python/src/mesh/mesh.cpp index f0a42a2c0..5a4b3f299 100644 --- a/bindings/python/src/mesh/mesh.cpp +++ b/bindings/python/src/mesh/mesh.cpp @@ -84,6 +84,7 @@ namespace geode void define_gradient_computation( pybind11::module& module ); void define_mesh_crs_helper( pybind11::module& ); void define_rasterize( pybind11::module& ); + void define_debug( pybind11::module& ); void define_vertex_set_io( pybind11::module& ); void define_graph_io( pybind11::module& ); @@ -170,6 +171,7 @@ PYBIND11_MODULE( opengeode_py_mesh, module ) geode::define_gradient_computation( module ); geode::define_mesh_crs_helper( module ); geode::define_rasterize( module ); + geode::define_debug( module ); geode::define_vertex_set_io( module ); geode::define_graph_io( module );