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 new split_bodies filter #104

Merged
merged 1 commit into from Feb 28, 2019
Merged

Add new split_bodies filter #104

merged 1 commit into from Feb 28, 2019

Conversation

banesullivan
Copy link
Member

Adds the ability to split all the different connected volumes/bodies in a dataset. This example is in the docs:

import numpy as np
import vtki
from vtki import examples
vtki.set_plot_theme('document')

# Load a simple example mesh
dataset = examples.load_uniform()
dataset.set_active_scalar('Spatial Cell Data')
threshed = dataset.threshold_percent([0.15, 0.50], invert=True)

bodies = threshed.split_bodies()

for i, body in enumerate(bodies):
    print('Body {} volume: {:.3f}'.format(i, body.volume))

bodies.plot(show_bounds=True, multi_colors=True)
Body 0 volume: 518.000
Body 1 volume: 35.000

split-bodies

@banesullivan banesullivan added the enhancement Changes that enhance the library label Feb 28, 2019
@codecov-io
Copy link

Codecov Report

Merging #104 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
+ Coverage   89.98%   90.05%   +0.06%     
==========================================
  Files          17       17              
  Lines        4294     4312      +18     
==========================================
+ Hits         3864     3883      +19     
+ Misses        430      429       -1
Impacted Files Coverage Δ
vtki/filters.py 99.66% <100%> (+0.02%) ⬆️
vtki/utilities.py 94.07% <0%> (+0.65%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef46fb5...56fbeb6. Read the comment docs.

@banesullivan banesullivan merged commit a154325 into master Feb 28, 2019
@banesullivan banesullivan deleted the split-bodies branch March 1, 2019 05:24
@banesullivan banesullivan modified the milestones: 0.17.1, 0.17.0 Mar 4, 2019
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.

None yet

2 participants