Clip: Broken compatibility between version 5.5.0 and 5.8.1
Paraview 5.8.1 produces unexpected results when running a python script written on Paraview 5.5.0 with clip function and ClipType.Bounds attribute and compatibility commands.
Steps to reproduce:
- open paraview gui
- click View > Python shell
- paste the following code in the Python shell
paraview.compatibility.major = 5 paraview.compatibility.minor = 5 box = Box() clip = Clip(Input=box, ClipType = 'Box') clip.ClipType.Position= [0.0, 0.0, 0.0] clip.ClipType.Bounds = [-1.0, 0.0, -1.0, 1.0, -1.0, 1.0] RenderView = GetActiveViewOrCreate('RenderView') boxdisplay = GetDisplayProperties(clip, view=RenderView)
- Press Enter
The code is supposed to make a zero centered unit cube and clip it on the yz axis. This code works fine with Paraview 5.5.0/5.6.0. The expected result is observed, i.e half a box.
Actual behavior (Paraview 5.8.1)
Setting attribute ClipType.Bounds results in unexpected clip.
I think the reason is that Paraview 5.8.1 has a new ClipType attribute, which has to be manually enabled before defining the ClipTyppe.Bounds attribute.
clip.ClipType.UseReferenceBounds = 1
I expected by defining compatibility commands on top of my script, setting the attribute ClipType.Bounds automatically sets .UseReferenceBounds to true, which would result in a correct clip.
I previously reported this here: https://discourse.paraview.org/t/problem-with-clip-in-paraview-5-8-0/5371/8