[vtkusers] Cutting non-convex surfaces

Dan Asimov dan.asimov at gmail.com
Tue Aug 16 16:05:16 EDT 2011


Hi David,

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.

Thanks,
Dan


On Tue, Aug 16, 2011 at 11:59 AM, David Gobbi <david.gobbi at gmail.com> wrote:

> Hi Dan,
>
> 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.
>
>  - David
>
>
> 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??
> >
> > Thanks,
> > Dan
> >
> >
> > 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
> >> problem.
> >>
> >> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110816/7a59d748/attachment.htm>


More information about the vtkusers mailing list