@@ -1145,18 +1145,29 @@ def get_splines(
11451145
11461146 return geometry_list_out
11471147
1148- def mesh2d_get_mesh_boundaries_as_polygons (self ) -> GeometryList :
1149- """Retrieves the boundaries of a mesh as a series of separated polygons.
1148+ def mesh2d_get_mesh_boundaries_as_polygons (
1149+ self , geometry_list : GeometryList
1150+ ) -> GeometryList :
1151+ """Retrieves the boundaries of a mesh as a series of separated polygons within the selecting polygon.
1152+ If the polygon is empty, all the mesh boundaries are retrieved.
11501153
11511154 For example, if a mesh has an single inner hole, two polygons will be generated,
11521155 one for the inner boundary and one for the outer boundary.
11531156
1157+ Args:
1158+ geometry_list (GeometryList): The selecting polygon.
1159+
11541160 Returns:
11551161 GeometryList: The output network boundary polygon.
11561162 """
11571163
11581164 # Get number of polygon nodes
1159- number_of_polygon_nodes = self ._mesh2d_count_mesh_boundaries_as_polygons ()
1165+ number_of_polygon_nodes = self ._mesh2d_count_mesh_boundaries_as_polygons (
1166+ geometry_list
1167+ )
1168+
1169+ # Create GeometryList instance
1170+ c_geometry_list_in = CGeometryList .from_geometrylist (geometry_list )
11601171
11611172 # Create GeometryList instance
11621173 x_coordinates = np .empty (number_of_polygon_nodes , dtype = np .double )
@@ -1168,24 +1179,36 @@ def mesh2d_get_mesh_boundaries_as_polygons(self) -> GeometryList:
11681179 self ._execute_function (
11691180 self .lib .mkernel_mesh2d_get_mesh_boundaries_as_polygons ,
11701181 self ._meshkernelid ,
1182+ byref (c_geometry_list_in ),
11711183 byref (c_geometry_list_out ),
11721184 )
11731185
11741186 return geometry_list_out
11751187
1176- def _mesh2d_count_mesh_boundaries_as_polygons (self ) -> int :
1177- """For internal use only.
1188+ def _mesh2d_count_mesh_boundaries_as_polygons (
1189+ self , geometry_list : GeometryList
1190+ ) -> int :
1191+ """For internal use only. Retrieves the number of boundaries of a mesh within the selecting polygon.
1192+ If the polygon is empty, all the mesh boundaries are considered.
11781193
11791194 Counts the number of polygon nodes contained in the mesh boundary polygons
11801195 computed in function mesh2d_get_mesh_boundaries_as_polygons.
11811196
1197+ Args:
1198+ geometry_list (GeometryList): The selecting polygon.
1199+
11821200 Returns:
11831201 int: The number of polygon nodes.
11841202 """
11851203 number_of_polygon_nodes = c_int ()
1204+
1205+ # Create GeometryList instance
1206+ c_geometry_list_in = CGeometryList .from_geometrylist (geometry_list )
1207+
11861208 self ._execute_function (
11871209 self .lib .mkernel_mesh2d_count_mesh_boundaries_as_polygons ,
11881210 self ._meshkernelid ,
1211+ byref (c_geometry_list_in ),
11891212 byref (number_of_polygon_nodes ),
11901213 )
11911214 return number_of_polygon_nodes .value
@@ -2171,32 +2194,6 @@ def curvilinear_refine(
21712194 c_int (refinement ),
21722195 )
21732196
2174- def curvilinear_derefine (
2175- self ,
2176- x_lower_left_corner : float ,
2177- y_lower_left_corner : float ,
2178- x_upper_right_corner : float ,
2179- y_upper_right_corner : float ,
2180- ) -> None :
2181- """Directional curvilinear grid derefinement.
2182- Additional gridlines are removed perpendicularly to the segment defined by lower_left_corner
2183- and upper_right_corner
2184-
2185- Args:
2186- x_lower_left_corner (float): The x coordinate of the lower left corner of the block to refine.
2187- y_lower_left_corner (float): The y coordinate of the lower left corner of the block to refine.
2188- x_upper_right_corner (float): The x coordinate of the upper right corner of the block to refine.
2189- y_upper_right_corner (float): The y coordinate of the upper right corner of the block to refine.
2190- """
2191- self ._execute_function (
2192- self .lib .mkernel_curvilinear_derefine ,
2193- self ._meshkernelid ,
2194- c_double (x_lower_left_corner ),
2195- c_double (y_lower_left_corner ),
2196- c_double (x_upper_right_corner ),
2197- c_double (y_upper_right_corner ),
2198- )
2199-
22002197 def curvilinear_compute_transfinite_from_polygon (
22012198 self ,
22022199 geometry_list : GeometryList ,
0 commit comments