View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001647VTK(No Category)public2005-03-07 04:092016-08-12 09:54
Reporterjohn platt 
Assigned ToKitware Robot 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001647: vtkCutter overwrites cell scalars cutting cells of different dimension
DescriptionI think there is a problem colour mapping cell scalars using vtkCutter on an unstructured

grid. Take a grid with 2 cells, a hex and a quad, and cut both cells by a plane.

Cutting the hex creates 2 triangles - vtkHexahedron::Contour() calls

      newCellId = polys->InsertNextCell(3,pts);
      outCd->CopyData(inCd,cellId,newCellId);

creating new triangles with newCellId = 0 & 1.

Cutting the quad gives a single line - vtkQuad::Contour() calls

      newCellId = lines->InsertNextCell(2,pts);
      outCd->CopyData(inCd,cellId,newCellId);

creating a new line with newCellId = 0.

Unfortunately, the CopyData() in vtkQuad::Contour() overwrites the cell data for the first

triangle. On more complex geometries this causes the renderer to crash because the cell data

is not present.

I think the calls to copy the cell data need the new cell Id in the aggregate polydata, not

the individual lines or polys - something like

      outCD->CopyData(inCd, cellId, vtkCutter->NumberOfNewCells++);
TagsNo tags attached.
Project
Type
Attached Files? file icon Hexahedron.vtk [^] (299 bytes) 2011-10-21 11:31

 Relationships

  Notes
(0002150)
Mathieu Malaterre (developer)
2005-03-07 10:40

John, do you have a dataset to reproduce ?
What if you change the line:

vtkQuad::Contour(...)
...
 vtkIdType offset = verts->GetNumberOfCells();

to also take into account the lines:

 vtkIdType offset = verts->GetNumberOfCells() + lines->GetNumberOfCells();


Thanks
(0002151)
Mathieu Malaterre (developer)
2005-03-07 10:59

John. I added a vtk dataset. Does this crash for you ?
(0002159)
john platt (reporter)
2005-03-07 19:45

As you suggested, in vtkQuad, I changed

    outCd->CopyData(inCd,cellId,newCellId);
to
       vtkIdType offset = verts->GetNumberOfCells()
                         + lines->GetNumberOfCells();
    outCd->CopyData(inCd,cellId,newCellId+offset);
    
but the cell colour of 1 triangle is still incorrect.

I don't know how the vertex, line & poly cell Id's are mapped to Id's in the aggregate polydata. Suppose all the verts come first, followed by the lines and then the polys. Then to get the correct cell Id for a line, I would need to know the total number of vertices in advance. I seem to recall a comment in vtkDataSetSurfaceFilter about cell ordering. This method may work if vtkCutter processed the cells in point, line, triangle order - only a guess.

Many thanks for you help - John.

(0036775)
Kitware Robot (administrator)
2016-08-12 09:54

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2008-11-30 09:23 Mathieu Malaterre Assigned To Mathieu Malaterre => François Bertel
2008-11-30 20:19 François Bertel Assigned To François Bertel =>
2011-06-16 13:11 Zack Galbreath Category => (No Category)
2016-08-12 09:54 Kitware Robot Note Added: 0036775
2016-08-12 09:54 Kitware Robot Status expired => closed
2016-08-12 09:54 Kitware Robot Resolution open => moved
2016-08-12 09:54 Kitware Robot Assigned To => Kitware Robot


Copyright © 2000 - 2018 MantisBT Team