[vtkusers] vtkMergePoints usage (Steve Boyd)

Doug McCorkle mccdo at iastate.edu
Thu Oct 9 08:02:29 EDT 2003


Steve,
     We also are having the same problems as you. I have been unable to
figure out how to use vtkMergePoints to accomplish this task. I have
also been unable to figure out an alternate way to remove coincident
points. If anyone has sample code that does this I would be interested
in the code.
Doug 

Message: 3
Date: Wed, 08 Oct 2003 15:05:55 -0700
From: Steve Boyd <skboyd at ucalgary.ca>
Organization: University of Calgary
To: vtk <vtkusers at public.kitware.com>
Subject: [vtkusers] vtkMergePoints usage

Hi,

I am trying to locate duplicate points using vtkMergePoints.  I am
successful at finding, for any given point, the closest point using
->FindClosestPoint(p1), but I when I try running ->IsUniquePoint(p1) I
get a runtime error (memory).  Am I using this class incorrectly?

    float p1[3];
    p1[0] = 2.0;
    p1[1] = 1.0;
    p1[2] = 0.5;

    vtkMergePoints *pointLocator = vtkMergePoints::New();
      pointLocator->SetDataSet(ug);	// ug is vtkUnstructuredGrid
data
      pointLocator->BuildLocator();

    // this line works fine
    cout << "Closest point is at id " <<
pointLocator->FindClosestPoint(p1) << endl;

    // this line gives a runtime error (regardless if p1 is unique or
not).
    cout << "Is it inserted? " << pointLocator->IsInsertedPoint(p1) <<
endl;

I'm guessing that this isn't a bug, but rather my incorrect usage of the
class.  Can somebody tell me how to use it properly?  

Regards,

Steve

-- 
Steven Boyd

PhD, PEng
Assistant Professor
Department of Mechanical and Manufacturing Engineering
University of Calgary
2500 University Drive, N.W.
Calgary, Alberta, Canada, T2N 1N4

tel. 1.403.220.4173  fax. 1.403.282.8406  skboyd at ucalgary.ca
-------------------------------------------------------------------







More information about the vtkusers mailing list