[vtkusers] How to extract area of (triangle) Cells?
Bryn Lloyd
blloyd at vision.ee.ethz.ch
Thu Dec 17 02:32:28 EST 2009
Another way to compute the area is via vtkMeshQuality.
First pass the mesh through this filter, compute the area for all
triangles (SetTriangleQualityMeasureToArea()), and the obtain the values
from the vtkCellData in the output.
Cheers
Bryn
lynx.abraxas at freenet.de wrote:
> Hello!
>
>
> I'd need to get the area of the cells (triangle) to weight the cell normals
> (as discussed in the thread below).
> My research on this lead me to http://www.cmake.org/Wiki/VTK_Examples where it
> says that CellData needs an associated data (eg. area of triangle). Would that
> be GetCellData().GetScalars()? Or would I need to apply a filter first that
> actually calculates the cell area or would I have to do that my self?
> I also found this example:
> http://www.cmake.org/Wiki/Add_Miscellaneous_Data_to_Cells_in_a_Polydata
> but the area there seems to me very arbritrary;-)
>
> Thanks for any help or hints.
> Lynx
>
>
>
> On 18/11/09 20:50:13, renlishen wrote:
>> I have seen the post "How to extract the average normal from
>> vtkPolyDataNormals",
>> and I try to do the same thing
>> ------------------------------------------------------
>> vtkPolyDataNormals *triangleCellNormals = vtkPolyDataNormals::New() ;
>> triangleCellNormals->SetInput(
>> triangleCellDataSetSurfaceFilter->GetOutput() ) ;
>> triangleCellNormals->ComputeCellNormalsOff() ;
>> triangleCellNormals->ComputePointNormalsOn() ;
>> triangleCellNormals->ConsistencyOn() ;
>> triangleCellNormals->AutoOrientNormalsOn() ;
>> triangleCellNormals->Update() ;
>>
>> vtkFloatArray *PointNormalArray = vtkFloatArray::SafeDownCast(
>> triangleCellNormals->GetOutput()->GetCellData()->GetNormals() ) ;
>> -------------------------------------------------------
>> My question is ..I can't connect GetCellData() to GetNormals()..
>> If the method is wrong, how can I do to get normals?
>>
>> I can display, but my goal is to get points' normal....
>> p.s. I am using VTK5.4.2...
>>
>> thanks for your help~!!
>> http://old.nabble.com/file/p26420378/1.png
>> --
>> View this message in context: http://old.nabble.com/About-vtkPolyDataNormals....-tp26420378p26420378.html
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
--
-------------------------------------------------
Bryn Lloyd
Computer Vision Laboratory
ETH Zürich, Sternwartstrasse 7, ETF C110
CH - 8092 Zürich, Switzerland
Tel: +41 44 63 26668
Fax: +41 44 63 21199
-------------------------------------------------
More information about the vtkusers
mailing list