# VTK Problems vtkPolyData::GetScalarFieldCriticalIndex

**URL:** <https://discourse.vtk.org/t/vtk-problems-vtkpolydata-getscalarfieldcriticalindex/7461>\
**Category:** Development\
**Created:** [December 22, 2021, 6:35am UTC](https://discourse.vtk.org/t/vtk-problems-vtkpolydata-getscalarfieldcriticalindex/7461 "2021-12-22T06:35:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexUtrobin](https://discourse.vtk.org/user_avatar/discourse.vtk.org/alexutrobin/32/4432_2.png) [@AlexUtrobin](https://discourse.vtk.org/u/AlexUtrobin)\
**Post date:** [December 22, 2021, 6:35am UTC](https://discourse.vtk.org/t/vtk-problems-vtkpolydata-getscalarfieldcriticalindex/7461/1 "2021-12-22T06:35:45Z")

</div>

Help! What am I doing wrong?

Java code:

```auto
    vtkPolyData pd = new vtkPolyData();

    vtkPoints points = new vtkPoints();
    points.InsertNextPoint(0, 0, 0);
    points.InsertNextPoint(5, 0, 0);
    points.InsertNextPoint(5, 5, 0);
    points.InsertNextPoint(0, 5, 0);
    points.InsertNextPoint(2.5, 2.5, 0);

    vtkDoubleArray da = new vtkDoubleArray();
    da.InsertNextValue(0);
    da.InsertNextValue(0);
    da.InsertNextValue(0);
    da.InsertNextValue(0);
    da.InsertNextValue(1);

    pd.SetPoints(points);
    pd.GetPointData().addArray(da);

    for (int i = 0; i < points.GetNumberOfPoints(); i++) {
        System.out.println(pd.GetScalarFieldCriticalIndex(i, 0));
    }

```

out:  
-3  
-3  
-3  
-3  
-3
