本文整理汇总了Python中anuga.shallow_water.shallow_water_domain.Domain.get_boundary_polygon方法的典型用法代码示例。如果您正苦于以下问题:Python Domain.get_boundary_polygon方法的具体用法?Python Domain.get_boundary_polygon怎么用?Python Domain.get_boundary_polygon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类anuga.shallow_water.shallow_water_domain.Domain
的用法示例。
在下文中一共展示了Domain.get_boundary_polygon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_pts_as_polygon
# 需要导入模块: from anuga.shallow_water.shallow_water_domain import Domain [as 别名]
# 或者: from anuga.shallow_water.shallow_water_domain.Domain import get_boundary_polygon [as 别名]
def load_pts_as_polygon(points_file, minimum_triangle_angle=3.0):
"""
WARNING: This function is not fully working.
Function to return a polygon returned from alpha shape, given a points file.
WARNING: Alpha shape returns multiple polygons, but this function only
returns one polygon.
"""
from anuga.pmesh.mesh import importMeshFromFile
from anuga.shallow_water.shallow_water_domain import Domain
mesh = importMeshFromFile(points_file)
mesh.auto_segment()
mesh.exportASCIIsegmentoutlinefile("outline.tsh")
mesh2 = importMeshFromFile("outline.tsh")
mesh2.generate_mesh(maximum_triangle_area=1000000000,
minimum_triangle_angle=minimum_triangle_angle,
verbose=False)
mesh2.export_mesh_file('outline_meshed.tsh')
domain = Domain("outline_meshed.tsh", use_cache = False)
polygon = domain.get_boundary_polygon()
return polygon