Skip to content

Commit

Permalink
-add python interface to m_generateInteriorPoints
Browse files Browse the repository at this point in the history
  • Loading branch information
alemon-aquaveo committed Aug 15, 2024
1 parent 4bb031a commit 4013b30
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _package/tests/unit_tests/multi_poly_mesher_io_pyt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions _package/xms/mesher/meshing/poly_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
5 changes: 5 additions & 0 deletions xmsmesher/python/meshing/MeMultiPolyMesherIo_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4013b30

Please sign in to comment.