diff --git a/testing/test_filter.py b/testing/test_filter.py index 9d31a17..f764762 100755 --- a/testing/test_filter.py +++ b/testing/test_filter.py @@ -864,22 +864,6 @@ def test_bad_shaped(): check_result(bf) -@pytest.mark.xfail -def test_no_contact(): - cubeA = vtkCubeSource() - cubeA.SetCenter(-1, 0, 0) - - cubeB = vtkCubeSource() - cubeB.SetCenter(1, 0, 0) - - bf = vtkPolyDataBooleanFilter() - bf.SetInputConnection(0, cubeA.GetOutputPort()) - bf.SetInputConnection(1, cubeB.GetOutputPort()) - bf.SetOperModeToNone() - bf.Update() - - check_result(bf) - @pytest.mark.xfail def test_self_intersecting_polys(): cube = vtkCubeSource() @@ -968,3 +952,30 @@ def test_invalid_capt_pts(): bf.Update() check_result(bf) + +@pytest.mark.xfail +def test_invalid_capt_pts_2(): + reader = vtkPolyDataReader() + reader.SetFileName('data/cross.vtk') + + cyl = vtkCylinderSource() + cyl.SetHeight(2.5) + cyl.SetResolution(12) + + z = .0000025 + + tra = vtkTransform() + tra.RotateZ(45) + tra.Translate(0, 0, z) + + tf = vtkTransformPolyDataFilter() + tf.SetTransform(tra) + tf.SetInputConnection(cyl.GetOutputPort()) + + bf = vtkPolyDataBooleanFilter() + bf.SetInputConnection(0, reader.GetOutputPort()) + bf.SetInputConnection(1, tf.GetOutputPort()) + bf.SetOperModeToNone() + bf.Update() + + check_result(bf) diff --git a/vtkPolyDataContactFilter.cxx b/vtkPolyDataContactFilter.cxx index 0278503..7720dd5 100644 --- a/vtkPolyDataContactFilter.cxx +++ b/vtkPolyDataContactFilter.cxx @@ -351,7 +351,7 @@ void vtkPolyDataContactFilter::GetInvalidEdges (vtkPolyData *pd, InvalidEdgesTyp auto cell = vtkSmartPointer::New(); - vtkIdType i, indexA, indexB, nextA, nextB, numNeigs; + vtkIdType indexA, indexB, nextA, nextB, numNeigs; auto lineItr = vtk::TakeSmartPointer(lines->GetLines()->NewIterator()); @@ -369,11 +369,7 @@ void vtkPolyDataContactFilter::GetInvalidEdges (vtkPolyData *pd, InvalidEdgesTyp cellsA->IntersectWith(cellsB); - std::set cellIds; - - for (i = 0; i < cellsA->GetNumberOfIds(); i++) { - cellIds.insert(cellsA->GetId(i)); - } + std::set cellIds(cellsA->begin(), cellsA->end()); numNeigs = 0;