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