vtkTexture repeat BUG: unexpected-extra repeat with squeezed shape

single Texture sample:
test


when we zoom in, we can see that there is squeezed repeats along rows of textures:

so I tried to repeat vtkTexture on a tubeActor, but there appears glitches, which I am pretty sure are squeezed textures.
Since I used vtkTransformTextureCoords to arrange texture coordinates, it should have generated exact number of repeats every row as I set. Now I don’t know where the problem is.

        int number = points.size();
        vtkSmartPointer<vtkPoints> pointsdata = vtkSmartPointer<vtkPoints>::New();
        int count = 0;
        for(auto it = points.begin(); it != points.end(); ++it,++count)//遍历点集并转换VTKpoints
        {
            auto current = *it;
            pointsdata->InsertPoint(count,current[0],current[1],current[2]);
        }

        vtkSmartPointer<vtkCellArray> lines=vtkSmartPointer<vtkCellArray>::New();
        lines->InsertNextCell(number);
        for(int i=0;i<number;i++)
        {
            lines->InsertCellPoint(i);
        }

        vtkSmartPointer<vtkPolyData> polyData=vtkSmartPointer<vtkPolyData>::New();
        polyData->SetPoints(pointsdata);
        polyData->SetLines(lines);

        vtkSmartPointer<vtkDoubleArray> tubeRadius=vtkSmartPointer<vtkDoubleArray>::New();
        tubeRadius->SetName("TubeRadius");
        tubeRadius->SetNumberOfTuples(number);

        auto itr = radiuslist.begin();
        for(int i=0;i<number;i++,++itr)//设置半径列表
        {
            double radius = *itr;
            tubeRadius->SetTuple1(i,radius);
        }
        polyData->GetPointData()->AddArray(tubeRadius);//将半径列表匹配vtkPolyData
        polyData->GetPointData()->SetActiveScalars("TubeRadius");
       vtkSmartPointer<vtkTubeFilter> tube=vtkSmartPointer<vtkTubeFilter>::New();
        tube->SetInputData(polyData);
        tube->SetNumberOfSides(64);
        tube->SetVaryRadiusToVaryRadiusByAbsoluteScalar();
        tube->SetGenerateTCoords(1);

        vtkSmartPointer<vtkTransformTextureCoords> xform = vtkSmartPointer<vtkTransformTextureCoords>::New();;
        xform->SetInputConnection(tube->GetOutputPort());
        xform->SetScale(number,7,0);
        xform->Update();

        auto mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
        mapper->SetInputConnection(xform->GetOutputPort());
        mapper->ScalarVisibilityOff();
       vtkSmartPointer<vtkPNGReader> reader = vtkSmartPointer<vtkPNGReader>::New();
        reader->SetFileName("C:/Users/Administrator/Desktop/test.png");
        reader->Update();

        vtkSmartPointer<vtkTexture> texture = vtkSmartPointer<vtkTexture>::New();
        texture->SetInputConnection(reader->GetOutputPort());
        texture->RepeatOn();
        texture->SetEdgeClamp(true);

        auto actor = vtkSmartPointer<vtkActor>::New();
        actor->SetMapper(mapper);
        actor->SetTexture(texture);

To have a better demonstration, I am using human picture for texture. and there are squeezed textures.

I looked vtkTextureMapToCylinder, it can do
image
Maybe that is the difference. Unfortunanately , I cannot use this since I need to tube based on a curved line and with different radius.
I probably try to do some research on the code behind “PreventSeamOn” and how I can do similar things on my tube actor.


There is, what I found in 2012 vtk pipeemail: now we know why the seam problem is happenning. But another problem is how I can calculate texture coordinates using 0.5/N at corner myself and apply them to what I have so far.

Found solution here: Unwanted interpolation in vtkTexture
when I turn on SeemlessV in PolyDataMapper, the “glitches” gone.
Instead, it tries to connect itself over the “seam”.
Look that nose, I hope that someone has better suggestions.