vtkImageCanvasSource2D::FillTriangle function can't Fill like (3, 3, 3, 50, 50, 3)
Code segment:
vtkSmartPointer<vtkImageCanvasSource2D> canvas =
vtkSmartPointer<vtkImageCanvasSource2D>::New();
canvas->SetScalarTypeToUnsignedChar();
canvas->SetNumberOfScalarComponents(1);
canvas->SetExtent(0, 100, 0, 100, 0, 0);
canvas->SetDrawColor(255, 0, 0, 0);
canvas->FillTriangle(3, 3, 3, 50, 50, 3);
canvas->Update();
Screenshot for application:
my src version is 9.2.2.
I read the implementation of vtkImageCanvasSource2DFillTriangle. you sort process seems can't achieve the goal in comment:
// Make life easier and order points so that ay < by < cy
if (c1 < a1)
{ // swap c and a
temp = a0;
a0 = c0;
c0 = temp;
temp = a1;
a1 = c1;
c1 = temp;
}
last code is in \VTK\VTK-9.2.2-src\Imaging\Sources\vtkImageCanvasSource2D.cxx's 482~491.
I don't know how to fix this. i just found this bug.