# Is this a bug for planeWidget?

**URL:** https://discourse.vtk.org/t/is-this-a-bug-for-planewidget/5793
**Category:** Support
**Created:** [May 16, 2021, 1:58pm UTC](https://discourse.vtk.org/t/is-this-a-bug-for-planewidget/5793 "2021-05-16T13:58:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![timeanddoctor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/timeanddoctor/32/2847_2.png) [@timeanddoctor](https://discourse.vtk.org/u/timeanddoctor)
#### Post date: [May 16, 2021, 1:58pm UTC](https://discourse.vtk.org/t/is-this-a-bug-for-planewidget/5793/1 "2021-05-16T13:58:27Z")

</div>

I created a planeWidget to cut the volume. However the volume was disappeared when I rotate the window to a angle by mouse.

```
 def clipPlane(obj, event):
            obj.GetPlane(clippingPlane)
            #planeWidget.GetPlane(clippingPlane)
            volumMapper.AddClippingPlane(clippingPlane)
            
            renWin.Render()
        
        
        
        ren.SetBackground(0.5, 0, 0.0)

        style = vtk.vtkInteractorStyleTrackballCamera()
        
        style.SetDefaultRenderer(ren)
        iren.SetInteractorStyle(style)
        renWin.GetInteractor().SetInteractorStyle(style)
        clippingPlane = vtk.vtkPlane()
        
        planeWidget.SetInteractor(iren)
        planeWidget.SetProp3D(volume)
        planeWidget.SetPlaceFactor(1.25)
        planeWidget.SetResolution(5)#//That is, set the number of meshes
        planeWidget.NormalToZAxisOn()#//Initial normal direction parallel to Z axis
        planeWidget.SetRepresentationToWireframe()#//Planes display as mesh properties
        planeWidget.SetCenter(volume.GetCenter())#//Set plane coordinates
        planeWidget.PlaceWidget()#//Lay the plane
        planeWidget.GetHandleProperty().SetOpacity(0)
        planeWidget.On()#//Display plane
        planeWidget.AddObserver("InteractionEvent", clipPlane)
```

---

<div class="post-metadata">

### Author: ![timeanddoctor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/timeanddoctor/32/2847_2.png) [@timeanddoctor](https://discourse.vtk.org/u/timeanddoctor)
#### Post date: [May 16, 2021, 1:58pm UTC](https://discourse.vtk.org/t/is-this-a-bug-for-planewidget/5793/2 "2021-05-16T13:58:45Z")

</div>

![bug Video_2021-05-16_214003](https://discourse.vtk.org/uploads/default/original/2X/6/642ccdf6e202cd02de21ed745933f3f2992a865d.gif)  
vtk==9.0.1

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [May 16, 2021, 2:53pm UTC](https://discourse.vtk.org/t/is-this-a-bug-for-planewidget/5793/3 "2021-05-16T14:53:43Z")

</div>

Combination of semi-transparent actors and volume rendering can be tricky. Enabling depth peeling may help. You may also try to adjust the camera clipping planes.
