[vtkusers] How to extract area of (triangle) Cells?
David Doria
daviddoria+vtk at gmail.com
Wed Dec 16 20:16:14 EST 2009
On Wed, Dec 16, 2009 at 7:58 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> It's 4 lines of code:
> triangle->GetPoints()->GetPoint(0, p0);
> triangle->GetPoints()->GetPoint(1, p1);
> triangle->GetPoints()->GetPoint(2, p2);
> double area = vtkTriangle::TriangleArea(p0, p1, p2);
I didn't see your declarations of p0,p1,p2 anywhere in there, so make it 7 :)
The point is that it should really be no more than 1 line:
double area = triangle->GetArea();
I claim that there is no user who would disagree.
Thanks,
David
More information about the vtkusers
mailing list