# Why vector diagrams using vtkCutter become vtkPlane normal vectors

**URL:** https://discourse.vtk.org/t/why-vector-diagrams-using-vtkcutter-become-vtkplane-normal-vectors/13196
**Category:** Support
**Created:** [January 31, 2024, 2:45am UTC](https://discourse.vtk.org/t/why-vector-diagrams-using-vtkcutter-become-vtkplane-normal-vectors/13196 "2024-01-31T02:45:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![emus.tk](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/e/3bc359/32.png) [@emus.tk](https://discourse.vtk.org/u/emus.tk)
#### Post date: [January 31, 2024, 2:45am UTC](https://discourse.vtk.org/t/why-vector-diagrams-using-vtkcutter-become-vtkplane-normal-vectors/13196/1 "2024-01-31T02:45:45Z")

</div>

I am implementing a program in C++ using the vtk9.3.0 library. The vector diagram of vtkUnstructuredGrid works normally, but when I draw a vector diagram on a cross section, it is aligned in the normal direction of the cut plane. Does anyone know the cause?

I implemented the program as follows.

// cx,cy,cz : org coord  
// nx,ny,nz : normal vector  
vtkSmartPointer plane = vtkSmartPointer::New();  
plane-\>SetOrigin(cx, cy, cz);  
plane-\>SetNormal(nx, ny, nz);

vtkSmartPointer cutter = vtkSmartPointer::New();  
cutter-\>SetInputData(unstructured\_grid);// unstructured\_grid vtkUnstructuredGrid  
cutter-\>SetCutFunction(plane);  
cutter-\>Update();

vtkSmartPointer lut;  
lut = setupColor(num\_color, alph);// generate for LookupTable

vtkSmartPointer glyph = vtkSmartPointer::New();  
glyph-\>SetInputConnection(cutter-\>GetOutputPort());  
glyph-\>SetRange(minval, maxval); // minval=minimum value, maxval=max value  
glyph-\>SetColorMode(VTK\_COLOR\_BY\_VECTOR);  
glyph-\>SetVectorModeToUseVector();  
glyph-\>SetScaleModeToScaleByVector();  
glyph-\>SetScaleFactor(scale);

vtkSmartPointer arrow = vtkSmartPointer::New();  
glyph-\>SetSourceConnection(arrow-\>GetOutputPort());  
glyph-\>Update();

vtkSmartPointer cut\_mapper = vtkSmartPointer::New();  
cut\_mapper-\>SetInputConnection(glyph-\>GetOutputPort());  
cut\_mapper-\>ScalarVisibilityOn();  
cut\_mapper-\>SetScalarRange(minval, maxval);  
cut\_mapper-\>SetLookupTable(lut);  
cut\_mapper-\>Update();

vtkSmartPointer cut\_actor = vtkSmartPointer::New();  
cut\_actor-\>SetMapper(cut\_mapper);

pWnd-\>getRenderer()-\>AddActor(cut\_actor);// pWnd : Qt MainWindow
