diff --git a/README.rst b/README.rst index a88cd1ad..b654e8e5 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ Motivation `PyVista`_ accessors for `Gmsh`_ to generate 3D finite element mesh. -The motivation is that PyVista is the solution to the following. +PyVista is the solution to the following. `Overview of Gmsh`_ @@ -30,24 +30,24 @@ We can define the surface using PyVista. .. code-block:: python - >>> square = pv.Polygon(n_sides=4, radius=8, fill=False) - >>> square = square.rotate_z(45, inplace=False) + >>> geometry = pv.Polygon(n_sides=4, radius=8, fill=False) + >>> geometry = geometry.rotate_z(45, inplace=False) We can then generate a 2D mesh. .. code-block:: python - >>> tess = pvgmsh.frontal_delaunay_2d(edge_source=square, mesh_size=1.0) + >>> mesh = pvgmsh.frontal_delaunay_2d(geometry, mesh_size=1.0) To visualize the model we can use PyVista. .. code-block:: python >>> plotter = pv.Plotter(off_screen=True) - >>> _ = plotter.add_mesh(tess, show_edges=True, line_width=4, color="white") - >>> _ = plotter.add_mesh(squar, show_edges=True, line_width=4, color="blue") + >>> _ = plotter.add_mesh(mesh, show_edges=True, line_width=4, color="white") + >>> _ = plotter.add_mesh(geometry, show_edges=True, line_width=4, color="blue") >>> _ = plotter.add_points( - ... squar.points, style="points", point_size=20, color="blue" + ... geometry.points, style="points", point_size=20, color="blue" ... ) >>> plotter.show(cpos="xy") diff --git a/src/pvgmsh/__init__.py b/src/pvgmsh/__init__.py index 07aa4f87..1c9a66e6 100644 --- a/src/pvgmsh/__init__.py +++ b/src/pvgmsh/__init__.py @@ -36,9 +36,9 @@ def frontal_delaunay_2d(edge_source, mesh_size=1e-2): >>> import pyvista as pv >>> import pvgmsh - >>> squar = pv.Polygon(n_sides=4, radius=8, fill=False) - >>> squar = squar.rotate_z(45, inplace=False) - >>> squar + >>> geometry = pv.Polygon(n_sides=4, radius=8, fill=False) + >>> geometry = geometry.rotate_z(45, inplace=False) + >>> geometry PolyData (...) N Cells: 1 N Points: 4 @@ -47,20 +47,20 @@ def frontal_delaunay_2d(edge_source, mesh_size=1e-2): Y Bounds: -5.657e+00, 5.657e+00 Z Bounds: 0.000e+00, 0.000e+00 N Arrays: 0 - >>> squar.points + >>> geometry.points pyvista_ndarray([[-5.656854, 5.656854, 0. ], [ 5.656854, 5.656854, 0. ], [ 5.656854, -5.656854, 0. ], [-5.656854, -5.656854, 0. ]], dtype=float32) - >>> squar.faces + >>> geometry.faces array([], dtype=int64) - >>> squar.lines + >>> geometry.lines array([5, 0, 1, 2, 3, 0]) - >>> tess = pvgmsh.frontal_delaunay_2d(edge_source=squar, mesh_size=1.0) + >>> mesh = pvgmsh.frontal_delaunay_2d(geometry, mesh_size=1.0) - >>> tess + >>> mesh UnstructuredGrid (...) N Cells: 398 N Points: 198 @@ -70,10 +70,10 @@ def frontal_delaunay_2d(edge_source, mesh_size=1e-2): N Arrays: 0 >>> plotter = pv.Plotter(off_screen=True) - >>> _ = plotter.add_mesh(tess, show_edges=True, line_width=4, color="white") - >>> _ = plotter.add_mesh(squar, show_edges=True, line_width=4, color="blue") + >>> _ = plotter.add_mesh(mesh, show_edges=True, line_width=4, color="white") + >>> _ = plotter.add_mesh(geometry, show_edges=True, line_width=4, color="blue") >>> _ = plotter.add_points( - ... squar.points, style="points", point_size=20, color="blue" + ... geometry.points, style="points", point_size=20, color="blue" ... ) >>> plotter.show(cpos="xy", screenshot="frontal_delaunay_2d_01.png") """