<!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>
        // 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">&lt;karthik.krishnan@kitware.com&gt;</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">&lt;nsarrasin@phenix-systems.com&gt;</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">&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 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 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 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>
</body>
</html>