Skip to content

Commit

Permalink
a new test
Browse files Browse the repository at this point in the history
  • Loading branch information
zippy84 committed Aug 30, 2023
1 parent 9cb5f7b commit db4f5d8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
16 changes: 16 additions & 0 deletions testing/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,3 +863,19 @@ def test_bad_shaped():
bf.Update()

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)
5 changes: 4 additions & 1 deletion vtkPolyDataBooleanFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ int vtkPolyDataBooleanFilter::ProcessRequest(vtkInformation *request, vtkInforma
#endif

if (contLines->GetNumberOfCells() == 0) {
vtkErrorMacro("There is no contact.");
return 1;
}

Expand Down Expand Up @@ -2893,6 +2892,8 @@ bool vtkPolyDataBooleanFilter::CombineRegions () {
regsA->ReverseCell(cellId);
}
}

cellItr->Delete();
}

if (comb[1] == Loc::INSIDE) {
Expand All @@ -2906,6 +2907,8 @@ bool vtkPolyDataBooleanFilter::CombineRegions () {
regsB->ReverseCell(cellId);
}
}

cellItr->Delete();
}

}
Expand Down
5 changes: 5 additions & 0 deletions vtkPolyDataContactFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ int vtkPolyDataContactFilter::ProcessRequest (vtkInformation *request, vtkInform
return 1;
}

if (contLines->GetNumberOfCells() == 0) {
vtkErrorMacro("There is no contact.");
return 1;
}

if (invalidA) {
vtkErrorMacro("First input has non-manifold edges.");
return 1;
Expand Down

0 comments on commit db4f5d8

Please sign in to comment.