connectivity->Update();
// bbSetOutputOut( connectivity->GetOutput() );
- printf("EED CleanMeshWithPatch::Process connectivity GetNumberOfPoints %ld \n ", connectivity->GetOutput()->GetNumberOfPoints() );
+// printf("EED CleanMeshWithPatch::Process connectivity GetNumberOfPoints %ld \n ", connectivity->GetOutput()->GetNumberOfPoints() );
/*
vtkAppendPolyData* append3 = vtkAppendPolyData::New();
connectivityClean->SetInputData( connectivity->GetOutput() );
connectivityClean->Update();
- //step 6.1. -- connect both meshes Patch->ConnectivityClean --
- Stretch( connectivityClean->GetOutput() , bbGetInputPatch() );
//step 6.2. -- connect both meshes ConnectivityClean->Patch --
Stretch( bbGetInputPatch(), connectivityClean->GetOutput() );
+ //step 6.1. -- connect both meshes Patch->ConnectivityClean --
+ Stretch( connectivityClean->GetOutput() , bbGetInputPatch() );
/*
//step 6.1. -- connect both meshes Patch->ConnectivityClean --
append2Clean->SetInputData( append2->GetOutput() );
append2Clean->Update();
-// vtkTriangleFilter *triangles = vtkTriangleFilter::New();
-// triangles->SetInputData( append2Clean->GetOutput() );
-// triangles->Update();
+ vtkTriangleFilter *triangles = vtkTriangleFilter::New();
+ triangles->SetInputData( append2Clean->GetOutput() );
+ triangles->Update();
// bbSetOutputOut( triangles->GetOutput() );
-
//step 8. -- Clean --
vtkPolyDataNormals *normals =vtkPolyDataNormals::New();
- // normals->SetInputConnection( triangles->GetOutputPort() );
+ normals->SetInputConnection( triangles->GetOutputPort() );
normals->SetInputConnection( append2Clean->GetOutputPort() );
normals->ConsistencyOn();
normals->SplittingOff();
normals->Update();
- bbSetOutputOut( normals->GetOutput() );
+// bbSetOutputOut( normals->GetOutput() );
-// vtkFillHolesFilter *fillHoles = vtkFillHolesFilter::New();
-// fillHoles->SetInputData( normals->GetOutput() );
-// fillHoles->SetHoleSize(1000);
-// fillHoles->Update();
-// bbSetOutputOut( fillHoles->GetOutput() );
+ vtkFillHolesFilter *fillHoles = vtkFillHolesFilter::New();
+ fillHoles->SetInputData( normals->GetOutput() );
+ fillHoles->SetHoleSize(1000);
+ fillHoles->Update();
+ bbSetOutputOut( fillHoles->GetOutput() );
/*
long int iIds,sizeArrayIds = edges->GetOutput()->GetNumberOfPoints();
-// vtkPolyData *newMesh = connectivityClean->GetOutput();
+//EED2
+ vtkIdFilter *idFilter2 = vtkIdFilter::New();
+ idFilter2->SetInputData( newMesh );
+ //idFilter2->SetIdsArrayName("ids");
+ //idFilter2->SetCellIdsArrayName("ids");
+ idFilter2->SetPointIdsArrayName("ids");
+ idFilter2->SetPointIds(true);
+ idFilter2->SetCellIds(false);
+//# Available for vtk>=8.3:
+// #idFilter2.SetPointIdsArrayName(arrayName)
+// #idFilter2.SetCellIdsArrayName(arrayName)
+ idFilter2->Update();
+ vtkFeatureEdges *edges2 = vtkFeatureEdges::New();
+ edges2->SetInputData( idFilter2->GetOutput() );
+ edges2->BoundaryEdgesOn();
+ edges2->ManifoldEdgesOff();
+ edges2->NonManifoldEdgesOff();
+ edges2->FeatureEdgesOff();
+ edges2->Update();
+ vtkIdTypeArray* arrayIds2 = vtkIdTypeArray::SafeDownCast(edges2->GetOutput()->GetPointData()->GetArray("ids"));
+ long int iIds2,sizeArrayIds2 = edges2->GetOutput()->GetNumberOfPoints();
+
+
+
+
vtkStaticPointLocator *pointLocator2 = vtkStaticPointLocator::New();
- pointLocator2->SetDataSet( newMesh );
+//EED2 pointLocator2->SetDataSet( newMesh );
+ pointLocator2->SetDataSet( edges2->GetOutput() );
+
pointLocator2->BuildLocator();
vtkPoints *pointsPatch = patchMesh->GetPoints();
vtkPoints *pointsNewMesh = newMesh->GetPoints();
for (iIds=0; iIds<sizeArrayIds ; iIds++ )
{
pointsPatch->GetPoint( arrayIds->GetValue(iIds) , pP );
- idNewMesh = pointLocator2->FindClosestPoint(pP);
+
+//EED2 idNewMesh = pointLocator2->FindClosestPoint(pP);
+ iIds2 = pointLocator2->FindClosestPoint(pP);
+ idNewMesh = arrayIds2->GetValue(iIds2);
+
pointsNewMesh->GetPoint( idNewMesh , pPP );
pointsPatch->SetPoint( arrayIds->GetValue(iIds) , pPP );
} // for iIds