From e4b28f19bb516e485384af17b5efee9225915cc0 Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Tue, 13 Aug 2024 14:55:47 +0900 Subject: [PATCH] Update api which is used in README.md (#318) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 237db1d2..5ec8026d 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ source = pv.Polygon(n_sides=4, radius=8, fill=False) We can then generate a 2D mesh. ```python -mesh = sg.frontal_delaunay_2d(edge_source=source, target_sizes=2.0) +delaunay_2d = Delaunay2d(edge_source=source, target_sizes=2.0) ``` To visualize the model, we can use PyVista. @@ -67,7 +67,7 @@ To visualize the model, we can use PyVista. ```python plotter = pv.Plotter() _ = plotter.add_mesh( - mesh, + delaunay_2d.mesh, show_edges=True, line_width=1, color="aliceblue", @@ -86,13 +86,13 @@ We can also generate a 3D mesh. ```python source = pv.Cube() -mesh = sg.delaunay_3d(edge_source=source, target_sizes=0.2) +delaunay_3d = Delaunay3D(edge_source=source, target_sizes=0.2) ``` ```python plotter = pv.Plotter() _ = plotter.add_mesh( - mesh, + delaunay_3d.mesh, show_edges=True, line_width=1, color="aliceblue", @@ -112,7 +112,9 @@ We can clip a mesh by a plane by specifying the origin and normal. See [clip_with_surface_example](https://docs.pyvista.org/examples/01-filter/clipping-with-surface#clip-with-surface-example) for more examples using this filter. ```python -clipped = mesh.clip(origin=(0.0, 0.0, 0.0), normal=(0.0, 0.0, 1.0), crinkle=True) +clipped = delaunay_3d.mesh.clip( + origin=(0.0, 0.0, 0.0), normal=(0.0, 0.0, 1.0), crinkle=True +) ```