[vtk-developers] Bug with pcoords[2] in vtkQuad::EvaluatePosition()

Mathieu Westphal mathieu.westphal at kitware.com
Thu May 28 05:36:36 EDT 2015


It seems some methods have not been thought with the 'output param must be
set' mindset
i've managed to fix most methods in all vtkCell implementation (i've mainly
Check linear 2D cells, as other implementation seemed to be alright )  but
i've left the Contour and Clip methods out, not knowing if it should reset
some parameters.

i've encountered some pcoords[0] = -10 ( really old code, 1994 ), is it
relevant in any way ?

See my new merge request :
https://gitlab.kitware.com/vtk/vtk/merge_requests/247

please let me know what you think, i hope that i've not overdone it.

Mathieu Westphal

PS : subId for non composite cell should be set to -1 instead of 0
shouldn't it ?

On Thu, May 28, 2015 at 9:40 AM, Mathieu Westphal <
mathieu.westphal at kitware.com> wrote:

> Here is the results of my enquiries on different cell types for
> evaluatePosition:
> vtkEmptyCell : pcoords not set at all, nor any output parameters.
> vtkVertex : pcoords[2] is not set
> vtkPolyVertex : pcoords[1] and pcoords[2] are not set
> vtkPolygon : pcoords[2] is not set
> vtkQuad : pcoords[2] is not set
>
> All other vtkCell implementation does set all pcoords, dist2 and
> closestPoints
>
> Do we set it to 0 ? do you know why vtkTriangle compute it this way when
> this is a 2D cell? (vtkTriangle.cxx:142)
>
> Mathieu Westphal
>
> On Wed, May 27, 2015 at 6:10 PM, Berk Geveci <berk.geveci at kitware.com>
> wrote:
>
>> Ah! I confirm that this is a bug. Any code that generically works on 2D
>> and 3D cells will trip over this in mixed 2D-3D cells situations as well as
>> if the outer code does not initialize pcoords to 0 initially. So any cell
>> type that uses a 2D parametric coordinate system should initialize the 3rd
>> value to 0. Please submit a fix for quad and I'll review/approve it. If you
>> have some cycles, I recommend checking the other 2D cells too...
>>
>> On Wed, May 27, 2015 at 11:48 AM, Joachim Pouderoux <
>> joachim.pouderoux at kitware.com> wrote:
>>
>>> Sorry, here is the correct entry link:
>>> http://www.vtk.org/Bug/view.php?id=15493
>>>
>>> *Joachim Pouderoux*
>>>
>>> *PhD, Technical Expert*
>>> *Kitware SAS <http://www.kitware.fr>*
>>>
>>>
>>> 2015-05-27 17:45 GMT+02:00 Berk Geveci <berk.geveci at kitware.com>:
>>>
>>>> Hi Mathieu,
>>>>
>>>> I don't see that issue in the tracker...
>>>>
>>>> -berk
>>>>
>>>>
>>>> On Wed, May 27, 2015 at 10:04 AM, Mathieu Westphal <
>>>> mathieu.westphal at kitware.com> wrote:
>>>>
>>>>> I've just submitted a bug in mantis
>>>>> http://www.vtk.org/Bug/view.php?id=15491
>>>>>
>>>>> pcoords[2] is not overwrited when i think should.
>>>>>
>>>>> The thing is, this but may be present in every 2D cell type.
>>>>> I've checked vtkTriangle, but this one seems ok, pcoords[2] is
>>>>> overwriten.
>>>>>
>>>>> What do you think about it ?
>>>>>
>>>>> Mathieu Westphal
>>>>>
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Search the list archives at:
>>>>> http://markmail.org/search/?q=vtk-developers
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://public.kitware.com/mailman/listinfo/vtk-developers
>>>>>
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Search the list archives at:
>>>> http://markmail.org/search/?q=vtk-developers
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://public.kitware.com/mailman/listinfo/vtk-developers
>>>>
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150528/41f7b351/attachment-0001.html>


More information about the vtk-developers mailing list