<!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>
}<br>
<br>
But my tmpDTArray is NULL.<br>
<br>
Is this the right way to do ? How to explain that my pointer is NULL ?<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 moz-do-not-send="true"
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 moz-do-not-send="true"
class="moz-txt-link-rfc2396E"
href="mailto:nsarrasin@phenix-systems.com"><nsarrasin@phenix-systems.com></a><br>
Cc: <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID:<br>
<a moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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>
<br>
<div class="moz-signature">-- <br>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Test_Signature</title>
<hr style="width: 100%; height: 2px;">
<table
style="text-align: left; font-family: Verdana; width: 500px; height: 110px;"
border="0" cellpadding="2" cellspacing="0">
<tbody>
<tr>
<td style="text-align: center; width: 80px; font-family: Verdana;"><a
href="www.phenix-systems.com"><img
style="border: 0px solid ; width: 75px; height: 66px;"
alt="Logo Phenix Systems"
src="cid:part1.09080703.07080803@phenix-systems.com"></a></td>
<td style="width: 506px; font-family: Verdana;"><small
style="color: rgb(51, 102, 102);"><span style="font-weight: bold;">Nicolas
Sarrasin - Ingénieur Developpement 3D CFAO</span><br
style="background-color: transparent;">
<a
style="background-color: transparent; text-decoration: underline;"
href="www.phenix-systems.com">Phenix systems</a><br
style="background-color: transparent; font-style: italic;">
<small><span
style="background-color: transparent; font-style: italic;"> Parc
Européen d'Entreprises </span><br
style="background-color: transparent; font-style: italic;">
<span style="background-color: transparent; font-style: italic;">rue
Richard Wagner - 63200 Riom FRANCE </span><br
style="font-style: italic;">
<span style="font-style: italic;">tel : +33 (0)4 73 33 45 85 |
fax : +33 (0)4 73 33 45 86 </span></small></small></td>
</tr>
<tr style="font-family: Verdana;">
<td colspan="2" rowspan="1" style="width: 80px;"><font
color="#36a629" size="2">Pensez environnement !</font><br>
<font color="#36a629" size="1">N'imprimez ce mail que si c'est
vraiment nécessaire</font></td>
</tr>
</tbody>
</table>
<br style="font-family: Verdana;">
</div>
<br>
</body>
</html>