Skip to content

Set enable parallel projection default in Plotter #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ To visualize the model we can use PyVista.

```python
plotter = sg.Plotter()
plotter.enable_parallel_projection()
_ = plotter.add_mesh(
mesh,
show_edges=True,
Expand All @@ -96,7 +95,6 @@ mesh = sg.delaunay_3d(edge_source, target_sizes=0.2)

```python
plotter = sg.Plotter()
plotter.enable_parallel_projection()
_ = plotter.add_mesh(
mesh,
show_edges=True,
Expand Down
4 changes: 1 addition & 3 deletions src/skgmsh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def frontal_delaunay_2d(
>>> mesh = sg.frontal_delaunay_2d(edge_source, target_sizes=2.0)

>>> plotter = sg.Plotter(off_screen=True)
>>> plotter.enable_parallel_projection()
>>> _ = plotter.add_mesh(mesh, show_edges=True, line_width=1, color="aliceblue", lighting=False, edge_color="gray")
>>> _ = plotter.add_mesh(edge_source, show_edges=True, line_width=4, color="gray")
>>> plotter.show(cpos="xy", screenshot="docs/_static/frontal_delaunay_2d_01.png")
Expand Down Expand Up @@ -146,7 +145,6 @@ def delaunay_3d(
>>> mesh = sg.delaunay_3d(edge_source, target_sizes=0.2)

>>> plotter = sg.Plotter(off_screen=True)
>>> plotter.enable_parallel_projection()
>>> _ = plotter.add_mesh(mesh, show_edges=True, line_width=1, color="aliceblue", lighting=False, edge_color="gray")
>>> _ = plotter.add_mesh(edge_source.extract_all_edges(), line_width=4, color="gray")
>>> _ = plotter.add_axes(
Expand All @@ -172,7 +170,6 @@ def delaunay_3d(
... edge_color="gray",
... )
>>> _ = plotter.add_mesh(edge_source.extract_all_edges(), line_width=4, color="gray")
>>> plotter.enable_parallel_projection()
>>> _ = plotter.add_axes(
... box=True,
... box_args={
Expand Down Expand Up @@ -349,6 +346,7 @@ def __init__(self: PlotterBase, *args, **kwargs) -> None: # type: ignore[no-unt

"""
super().__init__(*args, **kwargs)
super().enable_parallel_projection() # type: ignore[misc]


class Plotter(PlotterBase, pv.Plotter): # type: ignore[misc]
Expand Down