<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"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></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'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'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 <<a href="mailto:dan.asimov@gmail.com" target="_blank">dan.asimov@gmail.com</a>> wrote:<br>
> Hi David,<br>
><br>
> Thanks for your reply.<br>
><br>
> Actually, I tried vtkStripper, but as you said it just generated a polyline<br>
> consists of the same line segments in the same wrong order, which is kind of<br>
> useless here.<br>
><br>
> I don't know but it looks to me that no filter will be able to get the<br>
> correct ("expected") order of the line segments except the cutter object<br>
> itself. After cutting, the result is just some scattered lines.<br>
><br>
> What do you think? Am I missing something??<br>
><br>
> Thanks,<br>
> Dan<br>
><br>
><br>
> On Tue, Aug 16, 2011 at 11:05 AM, David Gobbi <<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>> wrote:<br>
>><br>
>> Hi Dan,<br>
>><br>
>> The fact that your surface is non-convex is not what is causing the<br>
>> problem.<br>
>><br>
>> The problem is that vtkCutter generates a whole bunch of independent<br>
>> line segments, but what you want is a single polyline. The filter to join<br>
>> the line segments to create a polyline in vtkStripper.<br>
>><br>
>> Also note that vtkStripper will _not_ put the points in the correct order.<br>
>> What it does is generate a polyline cell array that contains the correct<br>
>> ordering of the PointIDs.<br>
>><br>
>> - David<br>
>><br>
>><br>
>> On Tue, Aug 16, 2011 at 8:38 AM, Dan Asimov <<a href="mailto:dan.asimov@gmail.com" target="_blank">dan.asimov@gmail.com</a>> wrote:<br>
>> ><br>
>> > Any idea anyone? Is there a way to cut non-convex surfaces?<br>
>> ><br>
>> ><br>
>> > Thanks,<br>
>> > Dan<br>
>> ><br>
>> ><br>
>> ><br>
>> > On Fri, Aug 12, 2011 at 2:47 PM, Dan Asimov <<a href="mailto:dan.asimov@gmail.com" target="_blank">dan.asimov@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> Hi,<br>
>> >><br>
>> >> I've a non-convex shape that I need to cut through. The user draws two<br>
>> >> contours parallel X-Y plane, then I generate the surface using<br>
>> >> vtkVoxelContoursToSurfaceFilter. However, when I cut with a plane<br>
>> >> parallel<br>
>> >> to x-y using vtkCutter, the order of the points of the generated result<br>
>> >> is<br>
>> >> messed up (pls see the attachments). I tried to run many filters on<br>
>> >> this<br>
>> >> result to get the expected one without success.<br>
>> >><br>
>> >> Can anyone help me on how to cut this surface to get the expected<br>
>> >> result?<br>
>> >><br>
>> >> Thanks,<br>
>> >> Dan<br>
</div></div></blockquote></div><br>