Skip to content

Commit

Permalink
deploy: a14f1f3
Browse files Browse the repository at this point in the history
  • Loading branch information
Huite committed Sep 2, 2024
1 parent b463b19 commit 5e97a1e
Show file tree
Hide file tree
Showing 101 changed files with 1,773 additions and 127 deletions.
Binary file modified .doctrees/api/api/pandamesh.GmshMesher.doctree
Binary file not shown.
Binary file modified .doctrees/api/api/pandamesh.TriangleMesher.doctree
Binary file not shown.
Binary file not shown.
Binary file modified .doctrees/api/index.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/examples/gmsh-basic.doctree
Binary file not shown.
Binary file modified .doctrees/examples/gmsh-fields.doctree
Binary file not shown.
Binary file modified .doctrees/examples/preprocessing.doctree
Binary file not shown.
Binary file modified .doctrees/examples/sg_execution_times.doctree
Binary file not shown.
Binary file modified .doctrees/examples/triangle-basic.doctree
Binary file not shown.
Binary file modified .doctrees/examples/triangle-geospatial.doctree
Binary file not shown.
Binary file modified .doctrees/sg_execution_times.doctree
Binary file not shown.
14 changes: 12 additions & 2 deletions _downloads/5bc19a906f7aee7609a9fe736a8fcec5/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@
gdf["cellsize"] = [2.0, 1.0, 1.0]
gdf.plot(edgecolor="k")

# %%
# We can identify these problematic intersections using
# :func:`pandamesh.find_edge_intersections`:

intersections = pm.find_edge_intersections(gdf.geometry)
fig, ax = plt.subplots()
gdf.plot(ax=ax, facecolor="none")
intersections.plot(ax=ax)

# %%
# A first step is to remove line segments that do not fall in any polygon:

Expand All @@ -234,9 +243,10 @@
# %%
# However, this doesn't create suitable input for meshing. The ``GmshMesher``
# appears to hang on this input, and Triangle generates a grid with very small
# triangles:
# triangles. Pandamesh errors on these intersections by default, but way may
# proceed:

vertices, faces = pm.TriangleMesher(resolved).generate()
vertices, faces = pm.TriangleMesher(resolved, intersecting_edges="warn").generate()
pm.plot(vertices, faces)

# %%
Expand Down
Binary file modified _downloads/79a425db58e6180cef408093f1ab28a8/preprocessing.zip
Binary file not shown.
Binary file modified _downloads/7a7ce2204255f277838397c00eecb9b7/gmsh-basic.zip
Binary file not shown.
Binary file modified _downloads/8d89d0cac7b99393a56c43d6bed625ed/triangle-basic.zip
Binary file not shown.
22 changes: 20 additions & 2 deletions _downloads/a977adb4611357edd665dfb42e7a7790/preprocessing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,24 @@
"donut = sg.Polygon(\n [\n [0.0, 0.0],\n [10.0, 0.0],\n [10.0, 10.0],\n [0.0, 10.0],\n ],\n holes=[\n [\n [2.0, 5.0],\n [5.0, 8.0],\n [8.0, 5.0],\n [5.0, 2.0],\n ]\n ],\n)\nline0 = shapely.LineString(\n [\n [-2.0, 0.0],\n [12.0, 10.0],\n ]\n)\nline1 = shapely.LineString(\n [\n [5.5, 9.0],\n [9.0, 5.5],\n ]\n)\n\ngdf = gpd.GeoDataFrame(geometry=[donut, line0, line1])\ngdf[\"cellsize\"] = [2.0, 1.0, 1.0]\ngdf.plot(edgecolor=\"k\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can identify these problematic intersections using\n:func:`pandamesh.find_edge_intersections`:\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"intersections = pm.find_edge_intersections(gdf.geometry)\nfig, ax = plt.subplots()\ngdf.plot(ax=ax, facecolor=\"none\")\nintersections.plot(ax=ax)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -220,7 +238,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"However, this doesn't create suitable input for meshing. The ``GmshMesher``\nappears to hang on this input, and Triangle generates a grid with very small\ntriangles:\n\n"
"However, this doesn't create suitable input for meshing. The ``GmshMesher``\nappears to hang on this input, and Triangle generates a grid with very small\ntriangles. Pandamesh errors on these intersections by default, but way may\nproceed:\n\n"
]
},
{
Expand All @@ -231,7 +249,7 @@
},
"outputs": [],
"source": [
"vertices, faces = pm.TriangleMesher(resolved).generate()\npm.plot(vertices, faces)"
"vertices, faces = pm.TriangleMesher(resolved, intersecting_edges=\"warn\").generate()\npm.plot(vertices, faces)"
]
},
{
Expand Down
Binary file not shown.
Binary file modified _downloads/d85ad210e21a91643987461e0d983111/gmsh-fields.zip
Binary file not shown.
Binary file modified _images/sphx_glr_preprocessing_010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_012.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_013.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_014.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_015.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_016.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_017.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_018.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/sphx_glr_preprocessing_019.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@
<article class="bd-article">

<h1>All modules for which code is available</h1>
<ul><li><a href="pandamesh/gmsh_enums.html">pandamesh.gmsh_enums</a></li>
<ul><li><a href="pandamesh/common.html">pandamesh.common</a></li>
<li><a href="pandamesh/gmsh_enums.html">pandamesh.gmsh_enums</a></li>
<li><a href="pandamesh/gmsh_mesher.html">pandamesh.gmsh_mesher</a></li>
<li><a href="pandamesh/preprocessor.html">pandamesh.preprocessor</a></li>
<li><a href="pandamesh/triangle_enums.html">pandamesh.triangle_enums</a></li>
Expand Down
Loading

0 comments on commit 5e97a1e

Please sign in to comment.