[vtk-developers] A possible bug and questions regarding the "polyhedral challenge" branch

Will Schroeder will.schroeder at kitware.com
Thu Apr 1 06:32:09 EDT 2010


Thanks for the feedback Takuya. Hua and I are aware of some of these
issues (the work is actively being implemented). This will definitely
help us produce better code in the end.

Based on what I understand of your questions and on the current state
of development the answers to your questions are 1) we haven't fully
addressed this yet, for many algorithms it doesn't matter but I
believe that in the end we will have to enforce a consistent ordering
(for rendering if nothing else); 2) global ids, inside the class a
mapping to local ids is made; 3) FindCell() will work, further testing
and possibly implementation will be required to make this so.

W

On Thu, Apr 1, 2010 at 5:59 AM, Takuya OSHIMA
<oshima at eng.niigata-u.ac.jp> wrote:
> Hi,
>
> I have a possible bug report and a couple of questions regarding the
> "polyhedral challenge" fork of VTK (git://github.com/huayang/VTK.git).
>
> The possible bug is in vtkUnstructuredGrid::InsertNextCell() that is
> used to insert a polyhedron. When a polyhedron is inserted for the
> first time in a vtkUnstructuredGrid that already has non-polyhedral
> cells, perhaps either FaceLocations should be padded until the current
> position (as attached below), or offset to the current position should
> be memorized and subtracted from cellId of
> this->FaceLocations->GetValue(cellId) in
> vtkUnstructuredGrid::GetFaces().
>
> The questions are as follows, which I hope to be clarified in the
> Doxygen docs eventually.
>
> 1. When inserting a polyhedral cell, does the ordering of the points
> in the faces array matter (clockwise/counterclockwise from inside of
> the cell)?
>
> 2. Should the point labels in the faces array be numbered globally, or
> locally?
>
> 3. Is vtkUnstructuredGrid::FindCell() supposed to work for polyhedral
> cells?
>
> Thanks for all the efforts of the developers!
>
> Takuya
>
> diff --git a/Filtering/vtkUnstructuredGrid.cxx b/Filtering/vtkUnstructuredGrid.cxx
> index a5c0deb..a6b917a 100644
> --- a/Filtering/vtkUnstructuredGrid.cxx
> +++ b/Filtering/vtkUnstructuredGrid.cxx
> @@ -900,6 +900,11 @@ InsertNextCell(int type, vtkIdType npts, vtkIdType *pts,
>     this->Faces->Allocate(this->Types->GetSize());
>     this->FaceLocations = vtkIdTypeArray::New();
>     this->FaceLocations->Allocate(this->Types->GetSize());
> +    // FaceLocations must be padded until the current position
> +    for(vtkIdType i = 0; i <= this->Types->GetMaxId(); i++)
> +      {
> +      this->FaceLocations->InsertNextValue(-1);
> +      }
>     }
>
>   // Okay the faces go in
> @@ -932,6 +937,11 @@ vtkIdType vtkUnstructuredGrid::SetAllFacesAtOnce(vtkCellArray *faces)
>     this->Faces->Allocate(this->Types->GetSize());
>     this->FaceLocations = vtkIdTypeArray::New();
>     this->FaceLocations->Allocate(this->Types->GetSize());
> +    // FaceLocations must be padded until the current position
> +    for(vtkIdType i = 0; i <= this->Types->GetMaxId(); i++)
> +      {
> +      this->FaceLocations->InsertNextValue(-1);
> +      }
>     }
>
> Takuya OSHIMA, Ph.D.
> Faculty of Engineering, Niigata University
> 8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>



-- 
William J. Schroeder, PhD
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder at kitware.com
http://www.kitware.com
(518) 881-4902



More information about the vtk-developers mailing list