Skip to content

Commit 3b4cd47

Browse files
authored
Added triangulation scaling factor (#220 | GRIDEDIT-1873)
1 parent 8a064c9 commit 3b4cd47

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

meshkernel/meshkernel.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,12 +608,18 @@ def mesh2d_make_global(
608608
c_int(num_latitude_nodes),
609609
)
610610

611-
def mesh2d_make_triangular_mesh_from_polygon(self, polygon: GeometryList) -> None:
611+
def mesh2d_make_triangular_mesh_from_polygon(
612+
self,
613+
polygon: GeometryList,
614+
scale_factor: float = float(-999.0),
615+
) -> None:
612616
"""Generates a triangular mesh2d within a polygon. The size of the triangles is determined from the length of
613617
the polygon edges.
614618
615619
Args:
616620
polygon (GeometryList): The polygon.
621+
scale_factor (float): Scaling factor for the triangulation, if negative value then a default will be used.
622+
The default scaling will be polygon dependent.
617623
"""
618624

619625
c_geometry_list = CGeometryList.from_geometrylist(polygon)
@@ -622,6 +628,7 @@ def mesh2d_make_triangular_mesh_from_polygon(self, polygon: GeometryList) -> Non
622628
self.lib.mkernel_mesh2d_make_triangular_mesh_from_polygon,
623629
self._meshkernelid,
624630
byref(c_geometry_list),
631+
c_double(scale_factor),
625632
)
626633

627634
def mesh2d_make_triangular_mesh_from_samples(

0 commit comments

Comments
 (0)