...
Het is ook mogelijk een driehoekig grid te genereren:
Code Block |
---|
efDef mesh2d_add_triangular(
network: Network, polygon: Union[Polygon, MultiPolygon], edge_length: float = None
) -> None:
"""Add triangular mesh to existing network. An orthogonal mesh is generated by the
meshkernel, which likely means that the given geometry is not completely filled. The
triangle discretization is determined based on the coordinates on the boundary of the
provided geometry. Giving an edge_length will discretize the polygon for you, but
you can also do this yourself.
Args:
network (Network): Network object to which the mesh is added
polygon (Union[Polygon, MultiPolygon]): Geometry within which the mesh is generated
edge_length (float, optional): Distance for which the polygon boundary is discretized (by approximation). Defaults to None.
"""
|
...
Code Block |
---|
mesh.mesh2d_add_rectilinear(network, rectangle, dx=1, dy=1)
clipgeo = MultiPolygon([box(-6, -1, -4, 2), box(4, 5, 7.2, 7.2)])
mesh.mesh2d_clip(network, clipgeo, deletemeshoption=1, inside=True) |
| Code Block |
---|
multipolygon = MultiPolygon([box(0, 0, 10, 10), box(12, 2, 19, 9)])
mesh.mesh2d_add_rectilinear(network, multipolygon, dx=1, dy=1)
river = LineString(np.c_[x, np.sin(x / 3) + 5]).buffer(0.5)
refinement = river.buffer(1)
mesh.mesh2d_refine(network, refinement, steps=1)
mesh.mesh2d_clip(network=network, polygon=GeometryList.from_geometry(river)) |
|
Image RemovedImage Added | |