<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [vtkusers] How to extract area of (triangle) Cells?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>The quality array is set near line 730 in my version of vtkMeshQuality (5.2). It appears that the quality->Delete(); method should be removed from line 445 and moved to line 745.<BR>
<BR>
Vince<BR>
<BR>
<BR>
----------------------<BR>
Associate Professor<BR>
Department of Radiology<BR>
0453-D JCP<BR>
200 Hawkins Drive<BR>
Iowa City, IA 52242<BR>
E-mail: vincent-magnotta@uiowa.edu<BR>
Phone: 319-356-8255 Fax: 319-353-6275<BR>
Website: <A HREF="http://www.radiology.uiowa.edu">http://www.radiology.uiowa.edu</A><BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: vtkusers-bounces@vtk.org on behalf of Bill Lorensen<BR>
Sent: Fri 12/18/2009 10:01 AM<BR>
To: David Doria<BR>
Cc: vtkusers@vtk.org<BR>
Subject: Re: [vtkusers] How to extract area of (triangle) Cells?<BR>
<BR>
David,<BR>
<BR>
I looked at the source for vtkMeshQuality and I think you have<BR>
uncovered a bug. I see vtkDoubleArray named "Quality" added to the<BR>
cell data, but I do not see where any data is added to the array.<BR>
<BR>
I noticed that that Graphics/Texting/Cxx/MeshQuality does not access<BR>
the CellData.<BR>
<BR>
If it's not tested it's broken,<BR>
<BR>
Bill<BR>
<BR>
On Fri, Dec 18, 2009 at 8:10 AM, David Doria <daviddoria+vtk@gmail.com> wrote:<BR>
> On Thu, Dec 17, 2009 at 11:14 AM, Bryn Lloyd <blloyd@vision.ee.ethz.ch><BR>
> wrote:<BR>
>><BR>
>> David,<BR>
>><BR>
>> Not sure, but it works in paraview doesn't it?<BR>
>><BR>
>> 1. Maybe inverted triangles (there was an issue in the past with inverted<BR>
>> tets).<BR>
>><BR>
>> 2. Maybe you don't have triangles, but strips?<BR>
>><BR>
>> /Bryn<BR>
>><BR>
><BR>
> Bryn,<BR>
> Hmm, I tried it with a sphere source run through vtkTriangleFilter. This<BR>
> should produce good triangles, right?<BR>
> vtkSmartPointer<vtkSphereSource> sphereSource =<BR>
> vtkSmartPointer<vtkSphereSource>::New();<BR>
> sphereSource->Update();<BR>
><BR>
> vtkSmartPointer<vtkTriangleFilter> triangleFilter =<BR>
> vtkSmartPointer<vtkTriangleFilter>::New();<BR>
> triangleFilter->SetInputConnection(sphereSource->GetOutputPort());<BR>
> triangleFilter->Update();<BR>
><BR>
> //vtkPolyData* mesh = sphereSource->GetOutput();<BR>
> vtkPolyData* mesh = triangleFilter->GetOutput();<BR>
> cout << "There are " << mesh->GetNumberOfCells() << " cells." << endl;<BR>
><BR>
> vtkSmartPointer<vtkMeshQuality> qualityFilter =<BR>
> vtkSmartPointer<vtkMeshQuality>::New();<BR>
> qualityFilter->SetInput(mesh);<BR>
> qualityFilter->SetTriangleQualityMeasureToArea();<BR>
> qualityFilter->Update();<BR>
><BR>
> vtkDataSet* qualityMesh = qualityFilter->GetOutput();<BR>
> vtkSmartPointer<vtkDoubleArray> qualityArray =<BR>
> vtkDoubleArray::SafeDownCast(qualityMesh->GetCellData()->GetArray("Quality"));<BR>
><BR>
> cout << "There are " << qualityArray->GetNumberOfTuples() << " values." <<<BR>
> endl;<BR>
><BR>
> for(unsigned int i = 0; i < qualityArray->GetNumberOfTuples(); i++)<BR>
> {<BR>
> double val;<BR>
> qualityArray->GetValue(i);<BR>
> cout << "value " << i << " : " << val << endl;<BR>
> }<BR>
> The output is still<BR>
> ...<BR>
> value 90 : 5.77804e-269<BR>
> value 91 : 5.77804e-269<BR>
> value 92 : 5.77804e-269<BR>
> ...<BR>
> Any thoughts?<BR>
> Thanks,<BR>
><BR>
> David<BR>
> _______________________________________________<BR>
> Powered by www.kitware.com<BR>
><BR>
> Visit other Kitware open-source projects at<BR>
> <A HREF="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</A><BR>
><BR>
> Please keep messages on-topic and check the VTK FAQ at:<BR>
> <A HREF="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</A><BR>
><BR>
> Follow this link to subscribe/unsubscribe:<BR>
> <A HREF="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>
><BR>
><BR>
_______________________________________________<BR>
Powered by www.kitware.com<BR>
<BR>
Visit other Kitware open-source projects at <A HREF="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</A><BR>
<BR>
Please keep messages on-topic and check the VTK FAQ at: <A HREF="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</A><BR>
<BR>
Follow this link to subscribe/unsubscribe:<BR>
<A HREF="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>