diff --git a/vespa/Delaunay/Testing/execute_Delaunay.py b/vespa/Delaunay/Testing/execute_Delaunay.py index 950f1aeb2984edd9a7c74be0f9b1f0529c37ef58..0c413c0cf60e5263327db7f43e86115c24281d11 100644 --- a/vespa/Delaunay/Testing/execute_Delaunay.py +++ b/vespa/Delaunay/Testing/execute_Delaunay.py @@ -1,10 +1,12 @@ -from vtk import vtkSphereSource, vtkShrinkPolyData +from vtk import vtkPlaneSource, vtkShrinkPolyData from vespa import vtkCGALDelaunay -sp = vtkSphereSource() +ps = vtkPlaneSource() +ps.SetXResolution(5) +ps.SetYResolution(5) pd = vtkShrinkPolyData() -pd.SetInputConnection(sp.GetOutputPort()) +pd.SetInputConnection(ps.GetOutputPort()) d2 = vtkCGALDelaunay.vtkCGALDelaunay2() d2.SetInputConnection(pd.GetOutputPort()) diff --git a/vespa/Delaunay/vtkCGALDelaunay2.cxx b/vespa/Delaunay/vtkCGALDelaunay2.cxx index b2eca9fc3ad7974ccac4aef4f49ea92341c8f0c1..8634af87fefe92e56d9a93436eb77c9b4e2aff5e 100644 --- a/vespa/Delaunay/vtkCGALDelaunay2.cxx +++ b/vespa/Delaunay/vtkCGALDelaunay2.cxx @@ -55,14 +55,14 @@ int vtkCGALDelaunay2::RequestData( { vtkErrorMacro("This dataset is 3D"); } - int d1 = 0, d2 = 1, d3 = 2; // z null - if (!rangeVal[0]) + int d1 = 0, d2 = 1, d3 = 2; // assume z is null + if (!rangeVal[0]) // x is null { - d1 = 2; - d2 = 0; - d3 = 1; + d1 = 1; + d2 = 2; + d3 = 0; } - if (!rangeVal[1]) + if (!rangeVal[1]) // y is null { d1 = 0; d2 = 2; @@ -88,7 +88,7 @@ int vtkCGALDelaunay2::RequestData( // each poly for (polysIt->GoToFirstCell(); !polysIt->IsDoneWithTraversal(); polysIt->GoToNextCell()) { - vtkIdList* p = polysIt->GetCurrentCell(); + vtkIdList* p = polysIt->GetCurrentCell(); std::list poly; // each segment of poly for (vtkIdType i = 0; i < p->GetNumberOfIds(); i++) @@ -106,13 +106,13 @@ int vtkCGALDelaunay2::RequestData( for (linesIt->GoToFirstCell(); !linesIt->IsDoneWithTraversal(); linesIt->GoToNextCell()) { // each segment of line - vtkIdList* l = linesIt->GetCurrentCell(); + vtkIdList* l = linesIt->GetCurrentCell(); std::list line; for (vtkIdType i = 1; i < l->GetNumberOfIds(); i++) { if (!std::get<1>(pts[l->GetId(i)])) { - std::cerr << "invalid line: " << l->GetId(i) << std::endl; + std::cerr << "intersecting line: " << l->GetId(i) << std::endl; continue; } auto point = std::get<0>(pts[l->GetId(i)]);