<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#003333">
<font size="-1"><font face="Tahoma">Thanks</font></font><font size="-1"><font
face="Tahoma"> for your reply Karthik.</font></font><font size="-1"><font
face="Tahoma"><br>
<br>
For the moment, i can get all of my contours separetly but I still need
help with evaluating the orientation of the normals.<br>
<br>
I looked around vtkPolyDataNormals to compute the normals then I tried
this :<br>
<br>
connectFilter->SetExtractionModeToAllRegions();<br>
connectFilter->SetInputConnection(sliceCutter->GetOutputPort());<br>
connectFilter->Update();<br>
<br>
int nbContours = connectFilter->GetNumberOfExtractedRegions();<br>
<br>
connectFilter->SetExtractionModeToSpecifiedRegions();<br>
<br>
for(int idx=0; idx<nbContours; idx++)<br>
{<br>
connectFilter->InitializeSpecifiedRegionList(); <br>
connectFilter->AddSpecifiedRegion(idx);<br>
connectFilter->Update();<br>
<br>
vtkSmartPointer<vtkPolyData> tmpPolyData =
vtkSmartPointer<vtkPolyData>::New();<br>
tmpPolyData->DeepCopy(connectFilter->GetOutput());<br>
tmpPolyData->Update();<br>
<br>
vtkSmartPointer<vtkPolyDataNormals> tmpNormals =
vtkSmartPointer<vtkPolyDataNormals>::New();<br>
tmpNormals->SetInput(tmpPolyData);<br>
tmpNormals->ComputeCellNormalsOn();<br>
tmpNormals->ComputePointNormalsOff();<br>
tmpNormals->Update();<br>
<br>
vtkSmartPointer<vtkDataArray> tmpDTArray =
tmpNormals->GetOutput()->GetCellData()->GetNormals();<br>
<br>
vtkSmartPointer<vtkFloatArray> normArray =
vtkFloatArray::SafeDownCast(tmpDTArray);</font></font><font size="-1"><font
face="Tahoma"><br>
// How to get the result ???<br>
}<br>
<br>
But my tmpDTArray is NULL.<br>
<br>
Is this the right way to do ?<br>
<br>
Thanks by advance<br>
<br>
Nicolas.</font></font><cite><font size="-1"><font face="Tahoma"><br>
<br>
Date: Wed, 26 May 2010 15:40:50 +0530<br>
From: Karthik Krishnan <a class="moz-txt-link-rfc2396E" href="mailto:karthik.krishnan@kitware.com"><karthik.krishnan@kitware.com></a><br>
Subject: Re: [vtkusers] vtkCutter Inner/Outter Contours<br>
To: Nicolas Sarrasin <a class="moz-txt-link-rfc2396E" href="mailto:nsarrasin@phenix-systems.com"><nsarrasin@phenix-systems.com></a><br>
Cc: <a class="moz-txt-link-abbreviated" href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID:<br>
<a class="moz-txt-link-rfc2396E" href="mailto:AANLkTimQhl-EFvnsgy4u8ZfGBFuh30h9fNWRJ2j0lITT@mail.gmail.com"><AANLkTimQhl-EFvnsgy4u8ZfGBFuh30h9fNWRJ2j0lITT@mail.gmail.com></a><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Pass the output of the cutter through a vtkPolyDatConnectivity filter.<br>
You'll then need to look at the orientation of the normals of each
connected<br>
component. The outer faces of the cut surface are going to be oriented
in<br>
another direction.<br>
<br>
<br>
On Wed, May 26, 2010 at 1:40 PM, Nicolas Sarrasin <<br>
<a class="moz-txt-link-abbreviated" href="mailto:nsarrasin@phenix-systems.com">nsarrasin@phenix-systems.com</a>> wrote:<br>
<br>
> Hi all,<br>
><br>
> I recently posted a message here :<br>
> <a class="moz-txt-link-freetext" href="http://www.vtk.org/pipermail/vtkusers/2010-May/109274.html">http://www.vtk.org/pipermail/vtkusers/2010-May/109274.html</a> but
didn't<br>
> received any answers.<br>
> I guess I wasn't clear, here comes a simplification :<br>
><br>
> I use vtkCutter to get planar slices from a stl file. From the
result (<br>
> vtkCutter->GetOutput() ) I get, I would like to know the
orientation of the<br>
> several contours I obtained (eg which are outter and which are
inner).<br>
><br>
> As previously, as preview of my problem :<br>
> <a class="moz-txt-link-freetext" href="http://img514.imageshack.us/img514/6747/orientationcontours.png">http://img514.imageshack.us/img514/6747/orientationcontours.png</a><br>
><br>
> Thanks by advance for helping me.<br>
><br>
> Nicolas</font></font></cite><br>
</body>
</html>