[vtkusers] Coincident points in polyline

Martin Baumann mailsgetlost at web.de
Thu Sep 7 13:39:16 EDT 2006


Hallo,

I am writing a particle tracing program. I use a vtkStreamTracer to 
calculate the poly line of the
trace. I get the following error:

ERROR: In /home/ry149/local/src/vtk/vtk-5.0/Filtering/vtkPolyLine.cxx, 
line 195
vtkPolyLine (0x987a90): Coincident points in polyline...can't compute 
normals

Here is a piece of code that causes the error:

  vtkStreamTracer* trace = vtkStreamTracer::New();
  trace->SetInput(_grid);
  trace->SetStartPosition(particle[0],particle[1],particle[2]);
  trace->SetMaximumPropagationUnitToTimeUnit();
  trace->SetMaximumPropagation(_integration_time);
  trace->SetInitialIntegrationStepUnitToTimeUnit();
  trace->SetInitialIntegrationStep(_integration_step);
  trace->SetIntegrationDirectionToForward();
  trace->SetIntegrator(rk4);      // rk4 is a runge kutta 4 integrator
  trace->Update();            // here the error is produced

  // output
  cout << "#Points = " << trace->GetOutput()->GetNumberOfPoints() << endl;
  for (int j=0; j<trace->GetOutput()->GetNumberOfPoints(); ++j)
    cout << j << ": (" << trace->GetOutput()->GetPoint(j)[0]
      << "," << trace->GetOutput()->GetPoint(j)[1]
      << "," << trace->GetOutput()->GetPoint(j)[2] << ")" << endl;

The output shows that the last two points within trace->GetOutput() are 
the same.
But why do I get an error? Has anyone experience with this problem?

Regards, M.B.




More information about the vtkusers mailing list