<div dir="ltr">As you saw, it&#39;s been through the bug tracker before... perhaps it was decided that the extra overhead wasn&#39;t worth solving what is probably an edge case for most people.<div><br></div><div>This time around you could add a flag to the class to do the extra &quot;joining up&quot;, but set the default to the old behaviour.</div>
<div><br></div><div>You could push a branch to Gerrit for review. <a href="http://www.vtk.org/Wiki/VTK/Git/Develop">http://www.vtk.org/Wiki/VTK/Git/Develop</a></div><div><br></div><div>Goodwin<br><div><div><br></div><div>
<br><br><div class="gmail_quote">On Fri, Dec 21, 2012 at 9:56 PM, pof <span dir="ltr">&lt;<a 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>It could be worth including this patch
      in the next vtk release, don&#39;t you think?<br>
      Maybe some people from Kitware have an opinion on this.<br>
      JD<br>
      <br>
      Le 21/12/2012 18:39, Goodwin Lawlor a écrit :<br>
    </div><div><div class="h5">
    <blockquote type="cite">
      <div dir="ltr">That&#39;s great. Best of luck with your project.
        <div><br>
        </div>
        <div>Goodwin<br>
          <br>
          <div class="gmail_quote">On Thu, Dec 20, 2012 at 10:11 PM, pof
            <span dir="ltr">&lt;<a 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>
                  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 écrit :<br>
                </div>
                <div>
                  <div>
                    <blockquote 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 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&#39;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
                                écrit :<br>
                              </div>
                              <div>
                                <div>
                                  <blockquote type="cite">
                                    <div dir="ltr">I think vtkStripper
                                      was originally written to quickly
                                      produce
                                      vtkTriangleStrip/vtkPolyLine primitives that
                                      would render faster, not a
                                      computational geometry type class
                                      that would produce the longest
                                      possible polylines... it is a
                                      visualization library after all. 
                                      <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: <a 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: <a 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 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.  This
                                            will break any<br>
                                            input polylines into line
                                            segments.  I don&#39;t know if
                                            it will help,<br>
                                            but it might.<br>
                                            <span><font color="#888888"><br>
                                                 - David<br>
                                              </font></span>
                                            <div>
                                              <div><br>
                                                On Sun, Dec 9, 2012 at
                                                2:48 PM, pof &lt;<a 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 &quot;T&quot;,
                                                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
                                                écrit :<br>
                                                &gt;&gt;<br>
                                                &gt;&gt; Is it?  Maybe
                                                it is.  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 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 écrit :<br>
                                                &gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt; Then
                                                where would the &quot;9&quot; 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.  It
                                                doesn&#39;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 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;    
                                                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;    
                                                2 18 0<br>
                                                &gt;&gt;&gt;&gt;&gt; I
                                                don&#39;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;    
                                                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 é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 &quot;T&quot;.<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;
                                                    - 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 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;
                                                   
                                                 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;
                                                   
                                                 sphereSource1-&gt;SetCenter(0.0,
                                                0.0, 0.0);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 sphereSource1-&gt;SetRadius(2.0f);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 sphereSource1-&gt;SetPhiResolution(20);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 sphereSource1-&gt;SetThetaResolution(20);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 sphereSource1-&gt;Update();<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 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;
                                                   
                                                 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;
                                                   
                                                 sphere1Mapper-&gt;ScalarVisibilityOff();<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 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;
                                                   
                                                 sphere1Actor-&gt;SetMapper(
                                                sphere1Mapper );<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 sphere1Actor-&gt;GetProperty()-&gt;SetOpacity(.3);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 sphere1Actor-&gt;GetProperty()-&gt;SetColor(1,0,0);<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 /////////////////////////<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     // BEGIN
                                                MODIFICATIONS //<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 /////////////////////////<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     // Create a planar
                                                object<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     // Define 4
                                                vertices<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 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;
                                                   
                                                 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;
                                                   
                                                 PlanePoints-&gt;InsertNextPoint(-3,
                                                -1, 0);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 PlanePoints-&gt;InsertNextPoint(3,
                                                -1, 0);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 PlanePoints-&gt;InsertNextPoint(-3,
                                                1, 0);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 PlanePoints-&gt;InsertNextPoint(3,
                                                1, 0);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     // Create 2
                                                trianglar faces<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 PlaneCells-&gt;InsertNextCell(3);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 PlaneCells-&gt;InsertCellPoint(0);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 PlaneCells-&gt;InsertCellPoint(1);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 PlaneCells-&gt;InsertCellPoint(2);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 PlaneCells-&gt;InsertNextCell(3);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 PlaneCells-&gt;InsertCellPoint(1);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 PlaneCells-&gt;InsertCellPoint(3);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 PlaneCells-&gt;InsertCellPoint(2);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     // Create the
                                                polydata from points and
                                                faces<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 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;
                                                   
                                                 ProtectionWall-&gt;SetPoints(PlanePoints);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 ProtectionWall-&gt;SetPolys(PlaneCells);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 /////////////////////////<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     // END
                                                MODIFICATIONS //<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 /////////////////////////<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 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;
                                                   
                                                 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;
                                                   
                                                 planeMapper-&gt;ScalarVisibilityOff();<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 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;
                                                   
                                                 planeActor-&gt;SetMapper(
                                                planeMapper );<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 planeActor-&gt;GetProperty()-&gt;SetOpacity(.3);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 planeActor-&gt;GetProperty()-&gt;SetColor(0,1,0);<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     // Get intersection
                                                segments (LINES) using
                                                the<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;

vtkIntersectionPolyDataFilter<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 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;
                                                   
                                                 intersectionPolyDataFilter-&gt;SplitFirstOutputOff();<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 intersectionPolyDataFilter-&gt;SplitSecondOutputOff();<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 intersectionPolyDataFilter-&gt;SetInputConnection(
                                                0,<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;

                                                sphereSource1-&gt;GetOutputPort()
                                                );<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 intersectionPolyDataFilter-&gt;SetInputConnection(
                                                1,<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;

                                                ProtectionWall-&gt;GetProducerPort()
                                                );<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 intersectionPolyDataFilter-&gt;Update();<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 /////////////////////////<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     // BEGIN
                                                MODIFICATIONS //<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 /////////////////////////<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     // 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;
                                                   
                                                 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;
                                                   
                                                 stripper-&gt;Update();<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     // 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;
                                                     // 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;
                                                   
                                                 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;
                                                   
                                                 wr-&gt;SetFileName(&quot;polylines.txt&quot;);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 wr-&gt;SetInputConnection(stripper-&gt;GetOutputPort());<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     wr-&gt;Write();<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 ///////////////////////<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     // END
                                                MODIFICATIONS //<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 ///////////////////////<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 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;
                                                   
                                                 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;
                                                   
                                                 intersectionMapper-&gt;ScalarVisibilityOff();<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 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;
                                                   
                                                 intersectionActor-&gt;SetMapper(
                                                intersectionMapper );<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 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;
                                                   
                                                 renderer-&gt;AddViewProp(sphere1Actor);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 renderer-&gt;AddViewProp(planeActor);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 renderer-&gt;AddViewProp(intersectionActor);<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 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;
                                                   
                                                 renderWindow-&gt;AddRenderer(
                                                renderer );<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;
                                                renWinInteractor =<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     
                                                 vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 renWinInteractor-&gt;SetRenderWindow(
                                                renderWindow );<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 renderWindow-&gt;Render();<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 renderWindow-&gt;SetSize(600,
                                                600);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 renderer-&gt;SetBackground(0.1,
                                                0.2, 0.4);<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                   
                                                 renWinInteractor-&gt;Start();<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
                                                &gt;&gt;&gt;&gt;&gt;&gt;&gt;
                                                     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 href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
                                                <br>
                                                Visit other Kitware
                                                open-source projects at
                                                <a 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 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 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>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br></div></div></div></div>