[vtk-developers] Adding ComputeArea() to vtkTriangle
kmorel at sandia.gov
Tue Dec 22 10:03:38 EST 2009
Why not have a default implementation that breaks the cell into simplicia (line segments, triangles, or tetrahedra)? That's what vtkCellIntegrator (attached) does.
On 12/22/09 7:53 AM, "David Doria" <daviddoria+vtk at gmail.com> wrote:
On Mon, Dec 21, 2009 at 10:53 AM, Moreland, Kenneth <kmorel at sandia.gov> wrote:
Yes, but the vtkCell classes (of which vtkTriangle is one) is not really like the vtkDataObject objects. These classes are designed to hold methods for common computations. For example, they already hold methods for computing interpolation, derivatives, contours, and intersections. In this regard, a method to compute the length/area/volume of the cell is wholly appropriate.
My only criticism (everyone has to have an opinion, right?) is that it would be helpful if there was a pure virtual method in vtkCell, perhaps called ComputeSize, that returned the length, area, or volume (depending on the dimensionality of the cell). That way you would not have to down cast the vtkCell to some known subclass and hope the implementation is there.
Now that I write this, it occurs to me that somewhere there is a vtkCellIntegrator in ParaView that does something similar. Perhaps the implementation of that could be duplicated in vtkCell.
On 12/18/09 12:15 PM, "Berk Geveci" <berk.geveci at kitware.com <http://firstname.lastname@example.org> > wrote:
I think Mathieu brings up an important point. I don't think this has
any direct impact on the issue here but it is still a good one. VTK
usually separates computation from the data structures. There is a
good reason behind this. For example, when you are computing the
volume of a polyhedron or performing some other numerical integration
over it, there may be more than one way to do it numerically. Some
more accurate but more costly, others less accurate but faster. This
is why you don't find a lot of computational geometry related methods
On Fri, Dec 18, 2009 at 11:09 AM, Mathieu Malaterre
<mathieu.malaterre at gmail.com <http://email@example.com> > wrote:
> Ok, my bad. I thought this was introducing a new framework to compute
> 2D area which seem difficult to extend to 3d cell.
> thanks for clarification.
> On Fri, Dec 18, 2009 at 5:05 PM, Bill Lorensen <bill.lorensen at gmail.com <http://firstname.lastname@example.org> > wrote:
>> vtkTriangle is a cell. It is not filter. It currently has a
>> TriangleArea() method, but it is cumbersome to use. David is proposing
>> a convenience method to do the computation. It calls the
>> TriangleArea() method but save the user from setting up the parameters
>> for that call.
>> On Fri, Dec 18, 2009 at 10:54 AM, David Doria <daviddoria+vtk at gmail.com <http://email@example.com> > wrote:
>>> On Fri, Dec 18, 2009 at 10:51 AM, Mathieu Malaterre
>>> <mathieu.malaterre at gmail.com <http://firstname.lastname@example.org> > wrote:
>>>> Hi David,
>>>> I do not have a strong opinion on this particular case.
>>>> However here is a couple of thoughts, I have from my modest
>>>> understanding of VTK.
>>>> 1. I would really separate source/sink from filter. You are writing a
>>>> partial filter (aka algorithm) in a data object.
>>>> 2. You are duplicating (possibly) code from vtkMeshQuality.
>>> 1) I'm not sure I follow. Isn't vtkTriangle an "object", not a "source" or
>>> 2) That is likely the case and that is exactly my point here -
>>> vtkMeshQuality (or anything else) should not have to implement this code, it
>>> should just be able to call ComputeArea() on a triangle object.
>>> Powered by www.kitware.com <http://www.kitware.com>
>>> Visit other Kitware open-source projects at
>>> Follow this link to subscribe/unsubscribe:
>> Powered by www.kitware.com <http://www.kitware.com>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>> Follow this link to subscribe/unsubscribe:
> Powered by www.kitware.com <http://www.kitware.com>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> Follow this link to subscribe/unsubscribe:
Powered by www.kitware.com <http://www.kitware.com>
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
Per Ken's suggestion, I am trying to implement a virtual double ComputeSize() function for vtkCell. There are a lot of cells! Many of which I have no idea how to get their size. Is it acceptable to somehow commit these changes without having all of them implemented? Something like a filler "return 0" and a comment "this function has not yet been implemented"?
The idea would be that then the framework is setup, so when a developer who is familiar with the particular cell subclass sees the missing implementation, they could easily fill it in.
**** Kenneth Moreland
*** Sandia National Laboratories
*** *** *** email: kmorel at sandia.gov
** *** ** phone: (505) 844-8919
*** web: http://www.cs.unm.edu/~kmorel
-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 13807 bytes
More information about the vtk-developers