clip_box behavior is broken
See original GitHub issueHi,
to follow up on the thread started in Discussions, clip_box behavior is broken, as the clipped part doesn’t match the passed box.
To Reproduce
import pyvista as pv
from pyvista import examples
mesh = examples.load_airplane()
# Use `pv.Box()` or `pv.Cube()` to create a region of interest
roi = pv.Cube(center=(0.9e3, 0.2e3, mesh.center[2]),
x_length=500, y_length=500, z_length=500)
extracted = mesh.clip_box(roi, invert=False)
p = pv.Plotter(shape=(1,2))
p.add_mesh(roi, opacity=0.75, color="red")
p.add_mesh(mesh)
p.subplot(0,1)
p.add_mesh(extracted)
p.add_mesh(roi, opacity=0.75, color="red")
p.link_views()
p.view_isometric()
p.show()
Screenshots
System Information:
Python 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
pyvista : 0.33.2
vtk : 9.0.1
numpy : 1.21.0
imageio : 2.14.1
appdirs : 1.4.4
scooby : 0.5.11
matplotlib : 3.4.2
PyQt5 : 5.12.3
IPython : 7.22.0
tqdm : 4.48.2
According to @banesullivan , the regresion occured in v.0.33.0
Also, from my investigations, in the previous example if instead of the Cube
object, we pass its bounds, then clipping is sane. However if the cube is rotated, then the clipping breaks (albeit in a different way).
Edit: to complete, the bug is not linked to the invert
parameter either
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
For an app with broken clipboard behavior, can I route the ...
I have a remote connection to a VM that is a bit of a problem. If I want to paste text into the...
Read more >My clipboard is broken, crashing, and is invisible whenever I ...
My clipboard is broken, crashing, and is invisible whenever I open it. Hello! Can anyone help me with my problem?
Read more >Inconsistent copy and paste behaviour. Is there a fix?
I've encountered what I can best describe as "unpredictable" behaviour of the "clipboard". But in its own way, it actually is "predictable"", as...
Read more >clipboard sharing in RDP sessions broken? - Devolutions Forum
6.0 I was able to cut and past from my local clipboard to the RDP session and vice-versa. Now I no longer have...
Read more >Different (broken) behaviour of "Reveal Sequence in Project ...
To clarify - the issue only occurs when, in the Project Panel, you have navigated into a bin that doesn't contain your sequence...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well seen! Indeed it does fix the problem 👍
I can prepare a PR to fix it.
Hi, I ran a git bisect, and found the regression occurred in commit 4b83f5c9
And more precisely, it’s the change to
utilities/geometric_objects.py
, setting the parameterclean=True
that made Cube not suitable to be passed toclib_box
. If we change the above example to passclean=False
to the Cube creation, then the clipping works as expected.I wonder if the Cube should be cleaned by default. If it does, maybe a warning should be placed in
clip_box
doc, and examples amended. What do you think?