Jay-Yu
(Jay Yu)
January 18, 2022, 10:15am
1
Could any one help me to solve this issue? the attached file is polyData with quadratic quad elements. when i display surface grid with version 9.0, everything is wonderful. but for version 9.1, some edges visibility are not correct. please see below pictures and file for details.
thanks for your kindly help!
testDisplay.vtp
cory.quammen
(Cory Quammen (Kitware))
January 18, 2022, 6:35pm
2
Hi, could you share the code you are using to generate the images above?
1 Like
mwestphal
(Mathieu Westphal (Kitware))
January 18, 2022, 9:50pm
3
Jay-Yu
(Jay Yu)
January 19, 2022, 12:55am
4
Dear Cory Quammen and Mathieu Westphal,
thanks for your reply. Below is the sample code i used to test and generate above images.
void testReadPolydata(int argc, char* argv[])
{
vtkNew<vtkXMLPolyDataReader> reader;
reader->SetFileName(argv[1]);
reader->Update();
auto poly = reader->GetOutput();
vtkNew<vtkOpenGLPolyDataMapper> mapper;
mapper->SetInputData(poly);
vtkNew<vtkActor> actor;
actor->SetMapper(mapper);
actor->GetProperty()->SetEdgeVisibility(1);
vtkNew<vtkRenderer> render;
render->AddViewProp(actor);
vtkNew<vtkRenderWindow> window;
window->AddRenderer(render);
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
renderWindowInteractor->SetRenderWindow(window);
renderWindowInteractor->Initialize();
window->Render();
renderWindowInteractor->Start();
}
thanks for your kindly help!
Jay-Yu
(Jay Yu)
February 15, 2022, 12:36am
5
Dear Cory Quammen,
this is still a problem in vtk master version. But I found out the key point is VTK_QUADRIC_EDGE in the test polyData. when i remove all quadric lines in the test PolyData, everything seems great! Could you help to solve this problem?
thanks for your help!
LexaMark
(Lexa Mark)
June 12, 2022, 2:02pm
6
I have found the same problem。
If the Cell that is not planar in the actor,the edges by calling SetEdgeVisibility(1) will be in disorder.
By hiding some actors,the wrong edges shown like below.
The newwest master version still has the problem.
1 Like
I couldn’t understand much but I guess the problem is around here:
ptIds[2] = this->GetOutputPointId(ids[i], input, newPts, outputPD);
newPolys->InsertNextCell(3, ptIds);
this->RecordOrigCellId(this->NumberOfNewCells, cellId);
outputCD->CopyData(cd, cellId, this->NumberOfNewCells++);
ptIds[toggle] = ptIds[2];
toggle = !toggle;
}
}
}
else if (cellType == VTK_QUADRATIC_TRIANGLE || cellType == VTK_BIQUADRATIC_TRIANGLE ||
cellType == VTK_QUADRATIC_QUAD || cellType == VTK_BIQUADRATIC_QUAD ||
cellType == VTK_QUADRATIC_LINEAR_QUAD || cellType == VTK_QUADRATIC_POLYGON ||
cellType == VTK_LAGRANGE_TRIANGLE || cellType == VTK_LAGRANGE_QUADRILATERAL ||
cellType == VTK_BEZIER_TRIANGLE || cellType == VTK_BEZIER_QUADRILATERAL)
{
// If one of the points is hidden (meaning invalid), do not
// extract surface cell.
// Removed checking for whether all points are ghost, because that's an
// incorrect assumption.
bool oneHidden = false;
pointIdList = cellIter->GetPointIds();
LexaMark
(Lexa Mark)
June 12, 2022, 5:12pm
8
All lines in yellow color in below figure should be not existed.
The abnormal lines are caused by the cells which are not planar while those cells are drawed by two triangles but not a quadrilateral edges.
LexaMark
(Lexa Mark)
June 12, 2022, 5:14pm
9
Maybe . Thanks for your attention. Waiting for the code check and the revision.
LexaMark
(Lexa Mark)
June 13, 2022, 9:10am
10
One vtkPolygon type Cell with 4 points was drawn by two triangles .
Edges are wrong in another model whith vtkPolygon type Cells and vtkHexahedron type Cells.
Who can help me?