Skip to content

Commit 5ef6912

Browse files
germa89akaszynski
andauthored
Added split_sharp_edges and feature angle to general plotter (#921)
* Added split_sharp_edges and feature angle to general plotter * Adding default * Forcing pyvista 0.33.2 * Update setup.py Co-authored-by: Alex Kaszynski <[email protected]>
1 parent f6733c0 commit 5ef6912

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

ansys/mapdl/core/plotting.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def general_plotter(
3636
render_lines_as_tubes=False,
3737
scalar_bar_args={},
3838
smooth_shading=None,
39+
split_sharp_edges=None,
40+
feature_angle=30.0,
3941
show_scalar_bar=None,
4042
# labels kwargs
4143
font_size=None,
@@ -152,6 +154,18 @@ def general_plotter(
152154
Smoothly render curved surfaces when plotting. Not helpful
153155
for all meshes.
154156
157+
split_sharp_edge : bool, optional
158+
Split sharp edges exceeding 30 degrees when plotting with
159+
smooth shading. Control the angle with the optional
160+
keyword argument ``feature_angle``.
161+
By default this is ``False``.
162+
163+
.. note:: Note that enabling this will create a copy of
164+
the input mesh within the plotter.
165+
166+
feature_angle : float, optional
167+
Angle to consider an edge a sharp edge. Default 30 degrees.
168+
155169
theme : pyvista.DefaultTheme, optional
156170
PyVista theme. Defaults to PyMAPDL theme.
157171
@@ -233,6 +247,8 @@ def general_plotter(
233247
show_edges=show_edges,
234248
edge_color=edge_color,
235249
smooth_shading=smooth_shading,
250+
split_sharp_edges=split_sharp_edges,
251+
feature_angle=feature_angle,
236252
point_size=point_size,
237253
line_width=line_width,
238254
show_scalar_bar=show_scalar_bar,

requirements_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ matplotlib==3.5.1
33
pandas==1.4.1
44
pytest==7.0.1
55
pytest-cov==3.0.0
6-
pyvista==0.32.1
6+
pyvista==0.33.2
77
scipy==1.8.0
88
vtk==9.0.3

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
install_requires = [
1919
"matplotlib>=3.0.0", # for colormaps for pyvista
2020
"numpy>=1.14.0",
21-
"pyvista>=0.32.0", # using new data attributes
21+
"pyvista>=0.33.0",
2222
"appdirs>=1.4.0",
2323
"tqdm>=4.45.0",
2424
"pyiges>=0.1.4",

0 commit comments

Comments
 (0)