MantisBT - VTK
View Issue Details
0011102VTK(No Category)public2010-08-06 16:462016-08-12 09:55
David Doria 
Dave DeMarle 
normalcrashsometimes
closedmoved 
 
 
0011102: vtkDelaunay2D with some pairs of datasets and transforms crashes
With the attached dataset and the transform defined in code below, vtkDelaunay2D crashes. With that dataset and a different transform all is well. With that transform and a different dataset all is well. I'm sure it has something to do with the degeneracy of the dataset, but there should be a check for that and an error thrown rather than a crash.

It looks like it happens in vtkDelaunay2D::CheckEdge.


#include <vtkPolyData.h>
#include <vtkImageData.h>
#include <vtkSmartPointer.h>
#include <vtkMath.h>
#include <vtkPlane.h>
#include <vtkLandmarkTransform.h>
#include <vtkTransformFilter.h>
#include <vtkDelaunay2D.h>
#include <vtkPointSource.h>
#include <vtkXMLPolyDataReader.h>
#include <vtkPlaneSource.h>
#include <vtkXMLPolyDataWriter.h>

int main()
{
  vtkSmartPointer<vtkXMLPolyDataReader> reader =
    vtkSmartPointer<vtkXMLPolyDataReader>::New();
  reader->SetFileName("../polydata.vtp");
  reader->Update();

  double sourceOrigin[3] = {-.5, .5, 0};
  double sourceP1[3] = {.5, .5, 0};
  double sourceP2[3] = {-.5, .5, -1};

  vtkSmartPointer<vtkPoints> sourcePoints =
      vtkSmartPointer<vtkPoints>::New();
  sourcePoints->InsertNextPoint(sourceOrigin);
  sourcePoints->InsertNextPoint(sourceP1);
  sourcePoints->InsertNextPoint(sourceP2);

  vtkSmartPointer<vtkPoints> targetPoints =
      vtkSmartPointer<vtkPoints>::New();
  targetPoints->InsertNextPoint(0,0,0);
  targetPoints->InsertNextPoint(0,1,0);
  targetPoints->InsertNextPoint(1,0,0);

  vtkSmartPointer<vtkLandmarkTransform> landmarkTransform =
      vtkSmartPointer<vtkLandmarkTransform>::New();
  landmarkTransform->SetSourceLandmarks(sourcePoints);
  landmarkTransform->SetTargetLandmarks(targetPoints);
  landmarkTransform->SetModeToRigidBody();
  landmarkTransform->Update();

  vtkSmartPointer<vtkPolyData> polydata =
      vtkSmartPointer<vtkPolyData>::New();
  polydata->SetPoints ( reader->GetOutput()->GetPoints() );

  vtkSmartPointer<vtkDelaunay2D> delaunay =
      vtkSmartPointer<vtkDelaunay2D>::New();
  delaunay->SetTransform(landmarkTransform);
  delaunay->SetInput(polydata);
  delaunay->Update();

  return EXIT_SUCCESS;
}
No tags attached.
related to 0012178closed Dave DeMarle vtkDelaunay2D fails to recover boundary 
? polydata.vtp (5,213) 2010-08-06 16:46
https://www.vtk.org/Bug/file/8304/polydata.vtp
Issue History
2010-08-06 16:46David DoriaNew Issue
2010-08-06 16:46David DoriaFile Added: polydata.vtp
2011-05-10 20:41David GobbiRelationship addedrelated to 0012178
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2013-07-22 18:20Dave DeMarleNote Added: 0031195
2013-07-22 18:20Dave DeMarleStatusbacklog => expired
2013-07-22 18:20Dave DeMarleAssigned To => Dave DeMarle
2016-08-12 09:55Kitware RobotNote Added: 0037190
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved

Notes
(0031195)
Dave DeMarle   
2013-07-22 18:20   
If the bug is still present in 6.0.0, please reopen this report.
(0037190)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.