本文整理匯總了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