當前位置: 首頁>>代碼示例>>Python>>正文


Python Domain.get_boundary_polygon方法代碼示例

本文整理匯總了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
開發者ID:GeoscienceAustralia,項目名稱:anuga_core,代碼行數:26,代碼來源:pts.py


注:本文中的anuga.shallow_water.shallow_water_domain.Domain.get_boundary_polygon方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。