François,<br><br>  I checked the code in vtkWedge.cxx in VTK 4.2 and 5.0.0, and the EvaluatePosition bug still happens exchanging the triangles!<br><br>  I'm sorry about the faces, I was confused because it seems the description of a wedge has changed since  VTK 
4.2. There in vtkWedge.h it said:<br><br>// vtkWedge is a concrete implementation of vtkCell to represent a linear 3D<br>// wedge. A wedge consists of two triangular and three quadrilateral faces<br>// and is defined by the six points (0-5). vtkWedge uses the standard
<br>// isoparametric shape functions for a linear pyramid. The pyramid is defined<br>// by the six points (0-5) where (0,1,2) is the base of the wedge which,<br>// using the right hand rule, forms a triangle whose normal points in
<br>// the direction of the opposite triangular face (3,4,5).<br><br>  To confuse even more, Mathieu Malaterre already said next version of the book would be updated to the 4.2 definition! ( <a href="http://public.kitware.com/pipermail/vtk-developers/2006-February/004004.html">
http://public.kitware.com/pipermail/vtk-developers/2006-February/004004.html</a> ) So I thought this would be the "correct" definition.<br>  The way it was in 4.2, it seemed consistent with hexas (base quad face poins towards opposite quad face) and pyras (base quad face points towards opposite vertex).
<br><br><div><span class="gmail_quote">On 5/12/06, <b class="gmail_sendername">Francois Bertel</b> <<a href="mailto:francois.bertel@kitware.com">francois.bertel@kitware.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Tadeu,<br><br>The description of the vtkWedge class says:<br><br>"(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)"
<br><br>I agree it is different from other cells but the description itself match the implementation. so GetFaceArray() is fine.<br>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
<br>toward the exterior is 3-5-4.<br><br>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.<br><br>Try thoses points instead:
<br><br>(8,0,8), (16,0,8), (16,8,8) (8,0,0), (16,0,0), (16,8,0)<br><br>and tells us if EvaluatePosition() stills return true.<br><br>I'm talking about VTK CVS.<br>Which version of VTK are you talking about? I don't see the piece of you mentioned in EvaluatePosition() in VTK CVS.
<br><br>Regards.<br><br>Tadeu Manoel wrote:<br>> There is a bug in vtkWedge::EvaluatePosition, it can tell a point is<br>> inside when in reality it is outside.<br>><br>> E.g, try to create a vtkWedge with the following points:
<br>> (8,0,0), (16,0,0), (16,8,0), (8,0,8), (16,0,8), (16,8,8)<br>><br>> And try to EvaluatePosition for point (17,6,4). It will return 1,<br>> telling it is inside.<br>><br>> A solution is to change the following code:
<br>><br>>   if ( pcoords[0] >= -0.001 && pcoords[0] <= 1.001 &&<br>>   pcoords[1] >= -0.001 && pcoords[1] <= 1.001 &&<br>>   pcoords[2] >= -0.001 && pcoords[2] <= 
1.001 )<br>><br>> To:<br>><br>>    if ( pcoords[0] >= -0.001 && pcoords[1] >= -0.001 &&<br>>        (pcoords[0] + pcoords[1]) <= 1.001 &&<br>>         pcoords[2] >= -0.001
 && pcoords[2] <= 1.001 )<br>><br>><br>><br>> There is another bug in its faces array (and with GetFace and GetFaceArray):<br>> The faces normals are pointing inside, instead of outside (as of all
<br>> other 3D cells).<br>> Instead of:<br>><br>> static int faces[5][4] = { {0,1,2,-1}, {3,5,4,-1},<br>>                            {0,3,4,1}, {1,4,5,2}, {2,5,3,0} };<br>><br>> It should be:<br>><br>
> static int faces[5][4] = { {0,2,1,-1}, {3,4,5,-1},<br>>                            {0,1,4,3}, {1,2,5,4}, {2,0,3,5} };<br>><br>><br>><br>> --<br>> Edson Tadeu M. Manoel<br>> ESSS - Engineering Simulation and Scientific Software
<br>> <a href="http://www.esss.com.br">http://www.esss.com.br</a><br></blockquote></div><br><br>--<br>Edson Tadeu M. Manoel<br>ESSS - Engineering Simulation and Scientific Software<br><a href="http://www.esss.com.br">http://www.esss.com.br
</a><br>