[vtk-developers] Bugs in vtkWedge

Francois Bertel francois.bertel at kitware.com
Fri May 12 15:33:21 EDT 2006


Ok I found the lines in EvaluatePosition, sorry. I got trouble with my eyes on Friday afternoon :-)
Your fix is right. My comment about the face orientation is still true.

Francois Bertel wrote:
> the piece of you mentioned -> the piece of code you mentioned
> 
> Francois Bertel wrote:
> 
>>Hi Tadeu,
>>
>>The description of the vtkWedge class says:
>>
>>"(0,1,2) is the base of the wedge which, using the right hand rule, forms a triangle whose normal points outward (away from the triangular face (3,4,5)"
>>
>>I agree it is different from other cells but the description itself match the implementation. so GetFaceArray() is fine.
>>Also  in the VTK text book, normal of 0-1-2  points toward the exterior and normal of 3-4-5 points toward face 0-1-2, so the face such that the normal points
>>toward the exterior is 3-5-4.
>>
>>The example you gave, according to this description is wrong because obviously the normal of the first face you defined points toward the other face.
>>
>>Try thoses points instead:
>>
>>(8,0,8), (16,0,8), (16,8,8) (8,0,0), (16,0,0), (16,8,0)
>>
>>and tells us if EvaluatePosition() stills return true.
>>
>>I'm talking about VTK CVS.
>>Which version of VTK are you talking about? I don't see the piece of you mentioned in EvaluatePosition() in VTK CVS.
>>
>>Regards.
>>
>>Tadeu Manoel wrote:
>>
>>
>>>There is a bug in vtkWedge::EvaluatePosition, it can tell a point is
>>>inside when in reality it is outside.
>>>
>>>E.g, try to create a vtkWedge with the following points:
>>>(8,0,0), (16,0,0), (16,8,0), (8,0,8), (16,0,8), (16,8,8)
>>>
>>>And try to EvaluatePosition for point (17,6,4). It will return 1,
>>>telling it is inside.
>>>
>>>A solution is to change the following code:
>>>
>>> if ( pcoords[0] >= -0.001 && pcoords[0] <= 1.001 &&
>>> pcoords[1] >= -0.001 && pcoords[1] <= 1.001 &&
>>> pcoords[2] >= -0.001 && pcoords[2] <= 1.001 )
>>>
>>>To:
>>>
>>>  if ( pcoords[0] >= -0.001 && pcoords[1] >= -0.001 &&
>>>      (pcoords[0] + pcoords[1]) <= 1.001 &&
>>>       pcoords[2] >= -0.001 && pcoords[2] <= 1.001 )
>>>
>>>
>>>
>>>There is another bug in its faces array (and with GetFace and GetFaceArray):
>>>The faces normals are pointing inside, instead of outside (as of all
>>>other 3D cells).
>>>Instead of:
>>>
>>>static int faces[5][4] = { {0,1,2,-1}, {3,5,4,-1},
>>>                          {0,3,4,1}, {1,4,5,2}, {2,5,3,0} };
>>>
>>>It should be:
>>>
>>>static int faces[5][4] = { {0,2,1,-1}, {3,4,5,-1},
>>>                          {0,1,4,3}, {1,2,5,4}, {2,0,3,5} };
>>>
>>>
>>>
>>>--
>>>Edson Tadeu M. Manoel
>>>ESSS - Engineering Simulation and Scientific Software
>>>http://www.esss.com.br
>>>
>>>
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>_______________________________________________
>>>vtk-developers mailing list
>>>vtk-developers at vtk.org
>>>http://www.vtk.org/mailman/listinfo/vtk-developers
>>
>>
>>
> 
> 


-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtk-developers mailing list