Skip to content

Commit

Permalink
Update api which is used in README.md (#318)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
tkoyama010 and pre-commit-ci[bot] authored Aug 13, 2024
1 parent 33bdac8 commit e4b28f1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ 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.

```python
plotter = pv.Plotter()
_ = plotter.add_mesh(
mesh,
delaunay_2d.mesh,
show_edges=True,
line_width=1,
color="aliceblue",
Expand All @@ -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",
Expand All @@ -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
)
```

<p align="center">
Expand Down

0 comments on commit e4b28f1

Please sign in to comment.