<!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-&gt;SetExtractionModeToAllRegions();<br>
   
connectFilter-&gt;SetInputConnection(sliceCutter-&gt;GetOutputPort());<br>
    connectFilter-&gt;Update();<br>
<br>
    int nbContours = connectFilter-&gt;GetNumberOfExtractedRegions();<br>
<br>
    connectFilter-&gt;SetExtractionModeToSpecifiedRegions();<br>
<br>
    for(int idx=0; idx&lt;nbContours; idx++)<br>
    {<br>
        connectFilter-&gt;InitializeSpecifiedRegionList(); <br>
        connectFilter-&gt;AddSpecifiedRegion(idx);<br>
        connectFilter-&gt;Update();<br>
<br>
        vtkSmartPointer&lt;vtkPolyData&gt; tmpPolyData =
vtkSmartPointer&lt;vtkPolyData&gt;::New();<br>
        tmpPolyData-&gt;DeepCopy(connectFilter-&gt;GetOutput());<br>
        tmpPolyData-&gt;Update();<br>
<br>
        vtkSmartPointer&lt;vtkPolyDataNormals&gt; tmpNormals =
vtkSmartPointer&lt;vtkPolyDataNormals&gt;::New();<br>
        tmpNormals-&gt;SetInput(tmpPolyData);<br>
        tmpNormals-&gt;ComputeCellNormalsOn();<br>
        tmpNormals-&gt;ComputePointNormalsOff();<br>
        tmpNormals-&gt;Update();<br>
<br>
        vtkSmartPointer&lt;vtkDataArray&gt; tmpDTArray =
tmpNormals-&gt;GetOutput()-&gt;GetCellData()-&gt;GetNormals();<br>
<br>
        vtkSmartPointer&lt;vtkFloatArray&gt; 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">&lt;karthik.krishnan@kitware.com&gt;</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">&lt;nsarrasin@phenix-systems.com&gt;</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">&lt;AANLkTimQhl-EFvnsgy4u8ZfGBFuh30h9fNWRJ2j0lITT@mail.gmail.com&gt;</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 &lt;<br>
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:nsarrasin@phenix-systems.com">nsarrasin@phenix-systems.com</a>&gt;
wrote:<br>
<br>
&gt;  Hi all,<br>
&gt;<br>
&gt; I recently posted a message here :<br>
&gt; <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>
&gt; received any answers.<br>
&gt; I guess I wasn't clear, here comes a simplification :<br>
&gt;<br>
&gt; I use vtkCutter to get planar slices from a stl file. From the
result (<br>
&gt; vtkCutter-&gt;GetOutput() ) I get, I would like to know the
orientation of the<br>
&gt; several contours I obtained (eg which are outter and which are
inner).<br>
&gt;<br>
&gt; As previously, as preview of my problem :<br>
&gt; <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>
&gt;<br>
&gt; Thanks by advance for helping me.<br>
&gt;<br>
&gt; 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>