<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Goodwin,<br>
      this is strange... I tried yesterday and I found it did not work
      (I must have done something with my testing).<br>
      I tested again, and this works.<br>
      Great and thanks<br>
      JD<br>
      <br>
      Le 20/12/2012 17:05, Goodwin Lawlor a &eacute;crit&nbsp;:<br>
    </div>
    <blockquote
cite="mid:CAEAdmCZg4jYVj-Nfq=pZtd9acCcVqCk7brzEGesFAq0__sOOJg@mail.gmail.com"
      type="cite">
      <div dir="ltr">JD,
        <div><br>
        </div>
        <div>Pass the final polyline through vtkCleanPolyData with 0.0
          tolerance (the default) and it should remove the coincident
          points.</div>
        <div><br>
        </div>
        <div>hth</div>
        <div><br>
        </div>
        <div>Goodwin<br>
        </div>
        <br>
        <div class="gmail_quote">On Thu, Dec 20, 2012 at 12:42 AM, pof <span
            dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:jd379252@gmail.com" target="_blank">jd379252@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF">
              <div>Goodwin,<br>
                <br>
                I tested the patch on the following simple case (5
                segments)<br>
                # vtk DataFile Version 3.0<br>
                vtk output<br>
                ASCII<br>
                DATASET POLYDATA<br>
                POINTS 6 float<br>
                1.7 0.5 0 2 0 0 1.7 -0.5 0 <br>
                1.6 -1 0 1.8 -0.2 0 1.6 1 0 <br>
                LINES 5 15<br>
                2 0 1 <br>
                2 2 3 <br>
                2 4 2 <br>
                2 1 4 <br>
                2 5 0 <br>
                <br>
                without the patch, 2 polylines are obtained from the
                vtkStripper<br>
                LINES 2 9<br>
                5 0 1 4 2 3 <br>
                2 5 0 <br>
                <br>
                whereas with the patch a single polyline is obained <br>
                LINES 1 8<br>
                7 5 0 0 1 4 2 3 <br>
                <br>
                Things are of course better, though a duplicate of one
                point (point 0 in this case) is obtained, which should
                obviously have been avoided.<br>
                So it looks there's stil some space to improve the
                patch.<br>
                <br>
                In any case, I thank you for sharing this information
                with me.<br>
                JD<br>
                <br>
                <br>
                Le 19/12/2012 10:04, Goodwin Lawlor a &eacute;crit&nbsp;:<br>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">I think vtkStripper was originally
                      written to quickly produce
                      vtkTriangleStrip/vtkPolyLine&nbsp;primitives&nbsp;that would
                      render faster, not a computational geometry type
                      class that would produce the longest possible
                      polylines... it is a visualization library&nbsp;after
                      all.&nbsp;
                      <div> <br>
                      </div>
                      <div>The seed point is arbitrary so you may not
                        get the outcome you were looking for.</div>
                      <div><br>
                      </div>
                      <div>See this 2002 post, that contains a patch
                        which may help:&nbsp;<a moz-do-not-send="true"
                          href="http://vtk.org/pipermail/vtkusers/2002-January/009372.html"
                          target="_blank">http://vtk.org/pipermail/vtkusers/2002-January/009372.html</a></div>
                      <div><br>
                      </div>
                      <div>There was a bug report too:&nbsp;<a
                          moz-do-not-send="true"
                          href="http://www.vtk.org/Bug/print_bug_page.php?bug_id=832"
                          target="_blank">http://www.vtk.org/Bug/print_bug_page.php?bug_id=832</a></div>
                      <div><br>
                      </div>
                      <div>hth</div>
                      <div><br>
                      </div>
                      <div> Goodwin</div>
                      <div><br>
                        <br>
                        <div class="gmail_quote">On Mon, Dec 10, 2012 at
                          2:51 AM, David Gobbi <span dir="ltr">&lt;<a
                              moz-do-not-send="true"
                              href="mailto:david.gobbi@gmail.com"
                              target="_blank">david.gobbi@gmail.com</a>&gt;</span>
                          wrote:<br>
                          <blockquote class="gmail_quote"
                            style="margin:0 0 0 .8ex;border-left:1px
                            #ccc solid;padding-left:1ex"> Insert
                            vtkTriangleFilter before vtkStripper. &nbsp;This
                            will break any<br>
                            input polylines into line segments. &nbsp;I don't
                            know if it will help,<br>
                            but it might.<br>
                            <span><font color="#888888"><br>
                                &nbsp;- David<br>
                              </font></span>
                            <div>
                              <div><br>
                                On Sun, Dec 9, 2012 at 2:48 PM, pof &lt;<a
                                  moz-do-not-send="true"
                                  href="mailto:jd379252@gmail.com"
                                  target="_blank">jd379252@gmail.com</a>&gt;

                                wrote:<br>
                                &gt; yes this is the way LINES objects
                                are written on vtk files.<br>
                                &gt; Ok, so I understand now the point
                                you were making about the "T", which was<br>
                                &gt; uncorrect.<br>
                                &gt;<br>
                                &gt; So back to the problem, why this
                                vtkStripper is not able to merge those 2<br>
                                &gt; lines?<br>
                                &gt;<br>
                                &gt; Le 09/12/2012 21:41, David Gobbi a
                                &eacute;crit :<br>
                                &gt;&gt;<br>
                                &gt;&gt; Is it? &nbsp;Maybe it is. &nbsp;When you
                                wrote the numbers, I assumed that<br>
                                &gt;&gt;<br>
                                &gt;&gt; all of the numbers that you
                                listed were just point indices.<br>
                                &gt;&gt;<br>
                                &gt;&gt;<br>
                                &gt;&gt; On Sun, Dec 9, 2012 at 1:37 PM,
                                pof &lt;<a moz-do-not-send="true"
                                  href="mailto:jd379252@gmail.com"
                                  target="_blank">jd379252@gmail.com</a>&gt;

                                wrote:<br>
                                &gt;&gt;&gt;<br>
                                &gt;&gt;&gt; Hum I see.<br>
                                &gt;&gt;&gt; (from what I understand),
                                the first integer of each line is simply
                                the<br>
                                &gt;&gt;&gt; number of points of the
                                corresponding LINE<br>
                                &gt;&gt;&gt;<br>
                                &gt;&gt;&gt; Le 09/12/2012 21:33, David
                                Gobbi a &eacute;crit :<br>
                                &gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt; Then where would the
                                "9" go?<br>
                                &gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt; The stripper uses a
                                simple algorithm, it just chooses a
                                starting<br>
                                &gt;&gt;&gt;&gt; point, goes as far as
                                it can in each direction to create the
                                first<br>
                                &gt;&gt;&gt;&gt; polyline, and then
                                repeats this procedure until all the
                                line segments<br>
                                &gt;&gt;&gt;&gt; are accounted for. &nbsp;It
                                doesn't exhaustively search though all<br>
                                &gt;&gt;&gt;&gt; permutations to see
                                which one gives the smallest number of
                                output<br>
                                &gt;&gt;&gt;&gt; polylines... that would
                                cause the algorithm to run many times
                                slower.<br>
                                &gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt; On Sun, Dec 9, 2012 at
                                1:12 PM, pof &lt;<a
                                  moz-do-not-send="true"
                                  href="mailto:jd379252@gmail.com"
                                  target="_blank">jd379252@gmail.com</a>&gt;

                                wrote:<br>
                                &gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt; Hi David<br>
                                &gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt; the first polyline
                                being:<br>
                                &gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; 9 0 1 2 3 4 5
                                19 6 7<br>
                                &gt;&gt;&gt;&gt;&gt; and the third
                                polyline (actually it is a segment)
                                being:<br>
                                &gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; 2 18 0<br>
                                &gt;&gt;&gt;&gt;&gt; I don't see why
                                they shoud not merge together as (unless
                                I<br>
                                &gt;&gt;&gt;&gt;&gt; misunderstand<br>
                                &gt;&gt;&gt;&gt;&gt; something):<br>
                                &gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; 10 18 0 1 2 3 4
                                5 19 6 7<br>
                                &gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt; Am I wrong?<br>
                                &gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt; Le 09/12/2012
                                21:05, David Gobbi a &eacute;crit :<br>
                                &gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt; Hi JD,<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt; It could only
                                merge those two lines if it joined them
                                with a "T".<br>
                                &gt;&gt;&gt;&gt;&gt;&gt; A polyline
                                cannot have any branches.<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; - David<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt; On Sun, Dec 9,
                                2012 at 12:16 PM, pof &lt;<a
                                  moz-do-not-send="true"
                                  href="mailto:jd379252@gmail.com"
                                  target="_blank">jd379252@gmail.com</a>&gt;

                                wrote:<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi all,<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; I get a
                                strange result (which may be a bug)
                                using vtk stripper, i.e.<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; it<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; does<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; not merge
                                LINES as polylines as it is expected to.<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; In this
                                example (see below an extract of the
                                polydata produced by<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkStripper), only 2 polylines should be
                                obtained, but vtkStripper<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; forgot<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; to<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; merge the
                                first and the third line together,
                                though they obviously<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; share<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; point with
                                Id=0 (btw, the fact that only Id 0
                                remains unmerged might<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; not<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; be<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; pure luck).<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; LINES 3 24<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; 9 0 1 2 3 4
                                5 19 6 7<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; 10 9 8 17
                                13 12 15 14 11 10 16<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; 2 18 0<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; Does
                                anybody have an idea or an explanation?<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; Thanks<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; JD<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; PS: Here
                                below is the complete source file that
                                generates these data<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; and<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; in<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; which
                                vtkStripper is used.<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                //////////////////////////////////////////////////////<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; // Example
                                modified from
                                IntersectionPolyDataFilter.cxx<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                //////////////////////////////////////////////////////<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; #include
                                &lt;vtkActor.h&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; #include
                                &lt;vtkIntersectionPolyDataFilter.h&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; #include
                                &lt;vtkPolyDataMapper.h&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; #include
                                &lt;vtkPolyDataWriter.h&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; #include
                                &lt;vtkProperty.h&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; #include
                                &lt;vtkRenderer.h&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; #include
                                &lt;vtkRenderWindow.h&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; #include
                                &lt;vtkRenderWindowInteractor.h&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; #include
                                &lt;vtkSmartPointer.h&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; #include
                                &lt;vtkSphereSource.h&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; #include
                                &lt;vtkCellArray.h&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; #include
                                &lt;vtkStripper.h&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; int
                                main(int argc, char *argv[])<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; {<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkSphereSource&gt;
                                sphereSource1 =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkSphereSource&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;sphereSource1-&gt;SetCenter(0.0, 0.0,
                                0.0);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;sphereSource1-&gt;SetRadius(2.0f);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;sphereSource1-&gt;SetPhiResolution(20);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;sphereSource1-&gt;SetThetaResolution(20);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;sphereSource1-&gt;Update();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkPolyDataMapper&gt;
                                sphere1Mapper =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;sphere1Mapper-&gt;SetInputConnection(<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                sphereSource1-&gt;GetOutputPort()<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; );<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;sphere1Mapper-&gt;ScalarVisibilityOff();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkActor&gt;
                                sphere1Actor =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkActor&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;sphere1Actor-&gt;SetMapper(
                                sphere1Mapper );<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;sphere1Actor-&gt;GetProperty()-&gt;SetOpacity(.3);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;sphere1Actor-&gt;GetProperty()-&gt;SetColor(1,0,0);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;/////////////////////////<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;//
                                BEGIN MODIFICATIONS //<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;/////////////////////////<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;//
                                Create a planar object<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;//
                                Define 4 vertices<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkPoints&gt;
                                PlanePoints =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkPoints&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkCellArray&gt;
                                PlaneCells =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkCellArray&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;PlanePoints-&gt;InsertNextPoint(-3, -1,
                                0);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;PlanePoints-&gt;InsertNextPoint(3, -1,
                                0);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;PlanePoints-&gt;InsertNextPoint(-3, 1,
                                0);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;PlanePoints-&gt;InsertNextPoint(3, 1,
                                0);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;//
                                Create 2 trianglar faces<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;PlaneCells-&gt;InsertNextCell(3);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;PlaneCells-&gt;InsertCellPoint(0);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;PlaneCells-&gt;InsertCellPoint(1);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;PlaneCells-&gt;InsertCellPoint(2);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;PlaneCells-&gt;InsertNextCell(3);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;PlaneCells-&gt;InsertCellPoint(1);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;PlaneCells-&gt;InsertCellPoint(3);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;PlaneCells-&gt;InsertCellPoint(2);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;//
                                Create the polydata from points and
                                faces<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkPolyData&gt;
                                ProtectionWall =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkPolyData&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;ProtectionWall-&gt;SetPoints(PlanePoints);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;ProtectionWall-&gt;SetPolys(PlaneCells);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;/////////////////////////<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;// END
                                MODIFICATIONS //<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;/////////////////////////<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkPolyDataMapper&gt;
                                planeMapper =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;planeMapper-&gt;SetInputConnection(<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                ProtectionWall-&gt;GetProducerPort()<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; );<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;planeMapper-&gt;ScalarVisibilityOff();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkActor&gt;
                                planeActor =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkActor&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;planeActor-&gt;SetMapper( planeMapper
                                );<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;planeActor-&gt;GetProperty()-&gt;SetOpacity(.3);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;planeActor-&gt;GetProperty()-&gt;SetColor(0,1,0);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;// Get
                                intersection segments (LINES) using the<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkIntersectionPolyDataFilter<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkIntersectionPolyDataFilter&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                intersectionPolyDataFilter<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; =
                                vtkSmartPointer&lt;vtkIntersectionPolyDataFilter&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;intersectionPolyDataFilter-&gt;SplitFirstOutputOff();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;intersectionPolyDataFilter-&gt;SplitSecondOutputOff();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;intersectionPolyDataFilter-&gt;SetInputConnection(
                                0,<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                sphereSource1-&gt;GetOutputPort() );<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;intersectionPolyDataFilter-&gt;SetInputConnection(
                                1,<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                ProtectionWall-&gt;GetProducerPort() );<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;intersectionPolyDataFilter-&gt;Update();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;/////////////////////////<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;//
                                BEGIN MODIFICATIONS //<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;/////////////////////////<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;// Try
                                to get the polylines (there should be 2)
                                from the<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; segments<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; (LINES)<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkStripper&gt;
                                stripper =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkStripper&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
stripper-&gt;SetInputConnection(intersectionPolyDataFilter-&gt;GetOutputPort());<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;stripper-&gt;Update();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;//
                                Save resulting polydata on a file, in
                                which we see that there<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; are 3<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; polylines
                                (actually the second polyline is ok,<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;// but
                                the first and third polylines should
                                have been further<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; merged<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkPolyDataWriter&gt;
                                wr =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkPolyDataWriter&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;wr-&gt;SetFileName("polylines.txt");<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;wr-&gt;SetInputConnection(stripper-&gt;GetOutputPort());<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;wr-&gt;Write();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;///////////////////////<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;// END
                                MODIFICATIONS //<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;///////////////////////<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkPolyDataMapper&gt;
                                intersectionMapper =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;intersectionMapper-&gt;SetInputConnection(<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                stripper-&gt;GetOutputPort()<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; );<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;intersectionMapper-&gt;ScalarVisibilityOff();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkActor&gt;
                                intersectionActor =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkActor&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;intersectionActor-&gt;SetMapper(
                                intersectionMapper );<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkRenderer&gt;
                                renderer =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkRenderer&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;renderer-&gt;AddViewProp(sphere1Actor);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;renderer-&gt;AddViewProp(planeActor);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;renderer-&gt;AddViewProp(intersectionActor);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkRenderWindow&gt;
                                renderWindow =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                vtkSmartPointer&lt;vtkRenderWindow&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;renderWindow-&gt;AddRenderer( renderer
                                );<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;
                                renWinInteractor =<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;
                                &nbsp;vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;renWinInteractor-&gt;SetRenderWindow(
                                renderWindow );<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;renderWindow-&gt;Render();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;renderWindow-&gt;SetSize(600, 600);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;renderer-&gt;SetBackground(0.1, 0.2,
                                0.4);<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;
                                &nbsp;renWinInteractor-&gt;Start();<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;return
                                EXIT_SUCCESS;<br>
                                &gt;&gt;&gt;&gt;&gt;&gt;&gt; }<br>
                                &gt;&gt;&gt;&gt;&gt;<br>
                                &gt;&gt;&gt;&gt;&gt;<br>
                                &gt;<br>
_______________________________________________<br>
                                Powered by <a moz-do-not-send="true"
                                  href="http://www.kitware.com"
                                  target="_blank">www.kitware.com</a><br>
                                <br>
                                Visit other Kitware open-source projects
                                at <a moz-do-not-send="true"
                                  href="http://www.kitware.com/opensource/opensource.html"
                                  target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
                                <br>
                                Please keep messages on-topic and check
                                the VTK FAQ at: <a
                                  moz-do-not-send="true"
                                  href="http://www.vtk.org/Wiki/VTK_FAQ"
                                  target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
                                <br>
                                Follow this link to
                                subscribe/unsubscribe:<br>
                                <a moz-do-not-send="true"
                                  href="http://www.vtk.org/mailman/listinfo/vtkusers"
                                  target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
                              </div>
                            </div>
                          </blockquote>
                        </div>
                        <br>
                      </div>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>