[vtkusers] How to extract area of (triangle) Cells?

lynx.abraxas at freenet.de lynx.abraxas at freenet.de
Wed Dec 16 17:16:17 EST 2009


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



More information about the vtkusers mailing list