Skip to content

Commit

Permalink
a test for invalid capt points 2
Browse files Browse the repository at this point in the history
  • Loading branch information
zippy84 committed Sep 14, 2023
1 parent 1295817 commit e989c94
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
43 changes: 27 additions & 16 deletions testing/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
8 changes: 2 additions & 6 deletions vtkPolyDataContactFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ void vtkPolyDataContactFilter::GetInvalidEdges (vtkPolyData *pd, InvalidEdgesTyp

auto cell = vtkSmartPointer<vtkIdList>::New();

vtkIdType i, indexA, indexB, nextA, nextB, numNeigs;
vtkIdType indexA, indexB, nextA, nextB, numNeigs;

auto lineItr = vtk::TakeSmartPointer(lines->GetLines()->NewIterator());

Expand All @@ -369,11 +369,7 @@ void vtkPolyDataContactFilter::GetInvalidEdges (vtkPolyData *pd, InvalidEdgesTyp

cellsA->IntersectWith(cellsB);

std::set<vtkIdType> cellIds;

for (i = 0; i < cellsA->GetNumberOfIds(); i++) {
cellIds.insert(cellsA->GetId(i));
}
std::set<vtkIdType> cellIds(cellsA->begin(), cellsA->end());

numNeigs = 0;

Expand Down

0 comments on commit e989c94

Please sign in to comment.