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

Crinkle clip #2316

Merged
merged 9 commits into from
Mar 28, 2022
Merged

Crinkle clip #2316

merged 9 commits into from
Mar 28, 2022

Conversation

banesullivan
Copy link
Member

@banesullivan banesullivan commented Mar 9, 2022

Resolve #2313 cc @liangwang0734

import pyvista as pv
import numpy as np

# Input mesh
mesh = pv.Wavelet()

# Perform the clip
normal = (1,1,1)
plane = pv.Plane(i_size=30, j_size=30, direction=normal)

clipped = mesh.clip(normal=normal)

# Crinkle the clip
crinkled = mesh.clip(normal=normal, crinkle=True)

# Plot comparison
p = pv.Plotter(notebook=0, shape=(1,2))
p.add_mesh(clipped, show_edges=True)
p.add_mesh(plane.extract_feature_edges(), color='r')
p.subplot(0,1)
p.add_mesh(crinkled, show_edges=True)
p.add_mesh(plane.extract_feature_edges(), color='r')
p.link_views()
p.show()

Screen Shot 2022-03-09 at 12 43 34 PM

import pyvista as pv
import numpy as np

# Input mesh
mesh = pv.Wavelet()

p = pv.Plotter(notebook=0)
p.add_mesh_clip_plane(mesh, crinkle=True)
p.show()

Screen Shot 2022-03-09 at 12 58 32 PM

@github-actions github-actions bot added the enhancement Changes that enhance the library label Mar 9, 2022
@codecov
Copy link

codecov bot commented Mar 9, 2022

Codecov Report

Merging #2316 (e4c9a2a) into main (945f36c) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2316      +/-   ##
==========================================
+ Coverage   93.52%   93.53%   +0.01%     
==========================================
  Files          74       74              
  Lines       15766    15789      +23     
==========================================
+ Hits        14745    14769      +24     
+ Misses       1021     1020       -1     

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.

Thank you for adding this feature. I have a few comments.

pyvista/core/filters/data_set.py Show resolved Hide resolved
pyvista/plotting/widgets.py Show resolved Hide resolved
pyvista/plotting/widgets.py Outdated Show resolved Hide resolved
Copy link
Member

@akaszynski akaszynski left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks Bane!

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.

LGTM

@akaszynski akaszynski merged commit 272c91a into main Mar 28, 2022
@akaszynski akaszynski deleted the feat/crinkle-clip branch March 28, 2022 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Changes that enhance the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clip without triangulate/crinkle
5 participants