Skip to content
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

Add constrained triangulation example #3448

Merged
merged 2 commits into from
Oct 12, 2022
Merged

Add constrained triangulation example #3448

merged 2 commits into from
Oct 12, 2022

Conversation

akaszynski
Copy link
Member

The docstring of the delaunay_2d filter is missing a constrained tesselation example.

import pyvista as pv

squar = pv.Polygon(n_sides=4, radius=8, fill=False).rotate_z(45, inplace=False)
circ0 = pv.Polygon(center=(2, 3, 0), n_sides=30, radius=1)
circ1 = pv.Polygon(center=(-2, -3, 0), n_sides=30, radius=1)
comb = circ0 + circ1 + squar
tess = comb.delaunay_2d(edge_source=comb)
tess.plot(cpos='xy')

tmp


As a bonus, converts optional to default in the docstring of this method.

@github-actions github-actions bot added the documentation Anything related to the documentation/website label Oct 11, 2022
@codecov
Copy link

codecov bot commented Oct 11, 2022

Codecov Report

Merging #3448 (752318e) into main (8683da1) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #3448      +/-   ##
==========================================
- Coverage   95.16%   95.16%   -0.01%     
==========================================
  Files          83       83              
  Lines       18476    18474       -2     
==========================================
- Hits        17583    17581       -2     
  Misses        893      893              

banesullivan
banesullivan previously approved these changes Oct 11, 2022
Copy link
Member

@banesullivan banesullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to plot comb before the triangulation to give more context

Otherwise, nice addition!

@akaszynski
Copy link
Member Author

Suddenly seeing instability with:

reading sources... [ 19%] api/plotting/charts/_autosummary/pyvista.plotting.charts.Axis
Fatal Python error: Segmentation fault

Current thread 0x00007f837d79b740 (most recent call first):
  File "/home/runner/work/pyvista/pyvista/pyvista/plotting/plotting.py", line 4328 in _run_image_filter
  File "/home/runner/work/pyvista/pyvista/pyvista/plotting/plotting.py", line 4389 in get_image_depth
  File "/home/runner/work/pyvista/pyvista/pyvista/plotting/plotting.py", line 6093 in show
  File "/home/runner/work/pyvista/pyvista/pyvista/plotting/charts.py", line 1438 in show
  File "/home/runner/work/pyvista/pyvista/pyvista/plotting/charts.py", line 113 in mem_sub
  File "<string>", line 4 in <module>
  File "/home/runner/work/pyvista/pyvista/pyvista/ext/plot_directive.py", line 328 in _run_code
  File "/home/runner/work/pyvista/pyvista/pyvista/ext/plot_directive.py", line 367 in render_figures
  File "/home/runner/work/pyvista/pyvista/pyvista/ext/plot_directive.py", line 502 in run
  File "/home/runner/work/pyvista/pyvista/pyvista/ext/plot_directive.py", line 173 in run

Looks like a charts issue, but it's unclear what's causing it.

Copy link
Member

@tkoyama010 tkoyama010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this. I am excited about this example.

pyvista/core/filters/poly_data.py Outdated Show resolved Hide resolved
Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>
@akaszynski
Copy link
Member Author

Going ahead and merging this. Would like to get the release process out soon and changes have been implemented. Thanks @banesullivan and @tkoyama010 for your reviews!

@akaszynski akaszynski merged commit 00bf13a into main Oct 12, 2022
@akaszynski akaszynski deleted the docs/bounded-tess branch October 12, 2022 23:13
@akaszynski akaszynski mentioned this pull request Nov 1, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Anything related to the documentation/website Hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants