<br>Hi David,<br><br>Thanks a lot. This solves it! I was actually passing the output of the stripper directly to vtkContourWidget which apparently depends on the points order and not on the polyline cell. I ordered the points before passing them and it works now.<br>

<br>Thanks,<br>Dan<br><br><br><div class="gmail_quote">On Tue, Aug 16, 2011 at 11:59 AM, David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Dan,<br>
<br>
The job of vtkStripper is to put the segments in the correct order, so if<br>
isn&#39;t doing that, then it is getting the wrong input, or you are incorrectly<br>
using its output.<br>
<br>
For the input: are you sure that the input to vtkCutter is a closed surface?<br>
It does not matter whether it is convex or not, only if it is closed.  So you<br>
cannot give it a wireframe as input, for example.<br>
<br>
For the output: are you going through the vtkPoints that are output from<br>
vtkStripper and expecting them to be in order?  Because they won&#39;t be<br>
(as I mentioned in my previous email).  If you need the actual points to<br>
be in order, you need to use the PointIds in the cell array to re-order them.<br>
A VTK polyline is not a list of points, it is a list of pointIds.<br>
<font color="#888888"><br>
 - David<br>
</font><div><div></div><div><br>
<br>
On Tue, Aug 16, 2011 at 9:45 AM, Dan Asimov &lt;<a href="mailto:dan.asimov@gmail.com" target="_blank">dan.asimov@gmail.com</a>&gt; wrote:<br>
&gt; Hi David,<br>
&gt;<br>
&gt; Thanks for your reply.<br>
&gt;<br>
&gt; Actually, I tried vtkStripper, but as you said it just generated a polyline<br>
&gt; consists of the same line segments in the same wrong order, which is kind of<br>
&gt; useless here.<br>
&gt;<br>
&gt; I don&#39;t know but it looks to me that no filter will be able to get the<br>
&gt; correct (&quot;expected&quot;) order of the line segments except the cutter object<br>
&gt; itself. After cutting, the result is just some scattered lines.<br>
&gt;<br>
&gt; What do you think? Am I missing something??<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Dan<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Aug 16, 2011 at 11:05 AM, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi Dan,<br>
&gt;&gt;<br>
&gt;&gt; The fact that your surface is non-convex is not what is causing the<br>
&gt;&gt; problem.<br>
&gt;&gt;<br>
&gt;&gt; The problem is that vtkCutter generates a whole bunch of independent<br>
&gt;&gt; line segments, but what you want is a single polyline.  The filter to join<br>
&gt;&gt; the line segments to create a polyline in vtkStripper.<br>
&gt;&gt;<br>
&gt;&gt; Also note that vtkStripper will _not_ put the points in the correct order.<br>
&gt;&gt; What it does is generate a polyline cell array that contains the correct<br>
&gt;&gt; ordering of the PointIDs.<br>
&gt;&gt;<br>
&gt;&gt;  - David<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Aug 16, 2011 at 8:38 AM, Dan Asimov &lt;<a href="mailto:dan.asimov@gmail.com" target="_blank">dan.asimov@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Any idea anyone? Is there a way to cut non-convex surfaces?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks,<br>
&gt;&gt; &gt; Dan<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Fri, Aug 12, 2011 at 2:47 PM, Dan Asimov &lt;<a href="mailto:dan.asimov@gmail.com" target="_blank">dan.asimov@gmail.com</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Hi,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I&#39;ve a non-convex shape that I need to cut through. The user draws two<br>
&gt;&gt; &gt;&gt; contours parallel X-Y plane, then I generate the surface using<br>
&gt;&gt; &gt;&gt; vtkVoxelContoursToSurfaceFilter. However, when I cut with a plane<br>
&gt;&gt; &gt;&gt; parallel<br>
&gt;&gt; &gt;&gt; to x-y using vtkCutter, the order of the points of the generated result<br>
&gt;&gt; &gt;&gt; is<br>
&gt;&gt; &gt;&gt; messed up (pls see the attachments). I tried to run many filters on<br>
&gt;&gt; &gt;&gt; this<br>
&gt;&gt; &gt;&gt; result to get the expected one without success.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Can anyone help me on how to cut this surface to get the expected<br>
&gt;&gt; &gt;&gt; result?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Thanks,<br>
&gt;&gt; &gt;&gt; Dan<br>
</div></div></blockquote></div><br>