From 4013b30df78b77471a5b6bf776ed7d1be7dd71a1 Mon Sep 17 00:00:00 2001 From: Alan <37482427+alemon-aquaveo@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:35:02 -0600 Subject: [PATCH] -add python interface to m_generateInteriorPoints --- _package/tests/unit_tests/multi_poly_mesher_io_pyt.py | 4 ++++ _package/xms/mesher/meshing/poly_input.py | 10 ++++++++++ xmsmesher/python/meshing/MeMultiPolyMesherIo_py.cpp | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/_package/tests/unit_tests/multi_poly_mesher_io_pyt.py b/_package/tests/unit_tests/multi_poly_mesher_io_pyt.py index 01433aed..11367851 100644 --- a/_package/tests/unit_tests/multi_poly_mesher_io_pyt.py +++ b/_package/tests/unit_tests/multi_poly_mesher_io_pyt.py @@ -187,6 +187,10 @@ def test_properties(self): seed_points = ((3, 3, 0), (4, 3, 0), (4, 8, 0), (3, 8, 0)) relaxation_method = "spring_relaxation" + self.assertTrue(pi.generate_interior_points) + pi.generate_interior_points = False + self.assertFalse(pi.generate_interior_points) + self.assertEqual(4, len(pi.outside_polygon)) pi.outside_polygon = outside_poly self.assert_arrays_equal(outside_poly, pi.outside_polygon) diff --git a/_package/xms/mesher/meshing/poly_input.py b/_package/xms/mesher/meshing/poly_input.py index 52150c69..d86e64bb 100644 --- a/_package/xms/mesher/meshing/poly_input.py +++ b/_package/xms/mesher/meshing/poly_input.py @@ -101,6 +101,16 @@ def polygon_corners(self, value): """Set corner nodes for creating meshes using the patch algorithm.""" self._instance.polyCorners = value + @property + def generate_interior_points(self): + """Generate interior points for the polygon.""" + return self._instance.generateInteriorPoints + + @generate_interior_points.setter + def generate_interior_points(self, value): + """Set whether to generate interior points for the polygon.""" + self._instance.generateInteriorPoints = value + @property def boundary_points_to_remove(self): """Outer boundary locations to remove after the paving process.""" diff --git a/xmsmesher/python/meshing/MeMultiPolyMesherIo_py.cpp b/xmsmesher/python/meshing/MeMultiPolyMesherIo_py.cpp index 5cb69c78..f08829d4 100644 --- a/xmsmesher/python/meshing/MeMultiPolyMesherIo_py.cpp +++ b/xmsmesher/python/meshing/MeMultiPolyMesherIo_py.cpp @@ -165,6 +165,11 @@ void initMePolyInput(py::module &m) { self.m_polyCorners = *xms::VecIntFromPyIter(patch_polygon_corners); }); // ------------------------------------------------------------------------- + // function: generateInternalPoints + // ------------------------------------------------------------------------- + polyInput.def_readwrite("generateInternalPoints", + &xms::MePolyInput::m_generateInteriorPoints); + // ------------------------------------------------------------------------- // function: boundPtsToRemove // ------------------------------------------------------------------------- polyInput.def_property("boundPtsToRemove",