<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Dan,<div class=""> </div><div class=""> Pardon the late reply. Yes, clipping without reconfiguring the pipeline works and indeed there are cases when the clipping plane doesn’t intersect the data to be clipped which results in an empty dataset, this is currently what I’m observing and I would like to preserve the data set in this instance. To rephrase my initial question, if the clipping plane contains the entire dataset to be clipped (preserve the dataset and do not bother executing all the unnecessary computation, just return exactly the dataset as the output of the clipper). If the clipping plane has been adjusted such that its plane now intersects the dataset then clip as necessary. All in all everything works, all I’m trying to achieve is optimize vtkClipPolyData to perform as described above.</div><div class=""><br class=""></div><div class="">Regards,</div><div class=""> Seun</div><div class=""> <br class=""><div><blockquote type="cite" class=""><div class="">On May 9, 2016, at 10:09 AM, Dan Lipsa <<a href="mailto:dan.lipsa@kitware.com" class="">dan.lipsa@kitware.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Does clipping without reconfiguring the pipeline work?<div class="">There are cases when the clipping plane does not intersect the data to be clipped in which case you'll get an empty dataset.</div><div class=""><br class=""></div><div class="">Dan</div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, May 6, 2016 at 4:23 PM, Seun Odutola <span dir="ltr" class=""><<a href="mailto:seun@rogue-research.com" target="_blank" class="">seun@rogue-research.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Hi Everyone,<div class=""> </div><div class=""> I have a situation where I feed an input (which is an output result of a vtkProbeFilter) to a vtkClipPolyData and subsequently pass it’s output to a vtkPolyDataMapper. Basically my pipeline is as follows </div><div class=""><br class=""></div><div class="">Mesh(polydata) (M) —> A—> B —> C</div><div class=""><br class=""></div><div class="">A - vtkProbeFilter</div><div class="">B - vtkClipPolyData</div><div class="">C - vtkPolyDataMapper</div><div class=""><br class=""></div><div class=""> I gathered from previous responses to my last message (see topic: How to bypass parts of vtk pipeline) that reconfiguring the pipeline as suggested in that thread was most likely the way to go about achieving that. However, I had an idea which I would like to propose. For instance in my situation as described above my application typically will not be making use of the vtkClipPolyData that often but it’s of utmost importance that I have it configured ready to go whenever the user needs to Clip, so I decided to peek at vtkClipPolyData’s RequestData function where I compare the input’s bounding box (in my case the box to my polydata result from A), if the clippolydata’s box contains M in it’s entirety then I would like the input to be the output of the clippolydata (result going into —> C) but if the clip polydata’s bounding box doesn’t contain M’s bounding box but just intersects it’s points then I would like to clip it and pass along the result to C.</div><div class="">Basically</div><div class="">1 - if B’s box contains M - skip</div><div class="">2 - if B doesn’t contain M but just intersects some of it’s point - then clip.</div><div class=""> I managed to get do the bounds checking that certifies the first part of my algorithm but the 2nd part is the tricky bit when I resize my clipper (in it’s U.I) and then expect the vtkClipPolyData to Clip it empties the entire polydata of M. I believe it has something to do setting the clipScalars. I also noticed the line below in vtkClipPolyData.cxx</div><div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><div style="margin:0px;line-height:normal" class=""><span style="color:rgb(187,44,162)" class="">for</span><span class=""> ( i=</span><span style="color:rgb(39,42,216)" class="">0</span><span class="">; i < numPts; i++ )</span></div><div style="margin:0px;line-height:normal" class=""><span class="">{</span></div><div style="margin:0px;line-height:normal" class=""><span class=""> <span style="white-space:pre-wrap" class=""> </span>s = </span><span style="color:rgb(187,44,162)" class="">this</span><span class="">->ClipFunction->FunctionValue(inPts->GetPoint(i));</span></div><div style="margin:0px;line-height:normal" class=""><span class=""><span style="white-space:pre-wrap" class=""> </span>tmpScalars->SetComponent(i,</span><span style="color:rgb(39,42,216)" class="">0</span><span class="">,s);</span></div><div style="margin:0px;line-height:normal" class=""><span class="">}</span></div></div></div><div class=""><br class=""></div><div class="">tends to be the bottleneck in my case, which is why I’m trying to find a way to just ignore the effect of B in the pipeline when I need not clip but process it when I need to clip. I understand from the code that when I need to clip the line above must be executed but when I don’t need to clip what could be done to replace this line because ultimately down the line the tmpScalars is set to the clipScalars which is needed for further computation. Thanks everyone</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Regards,</div><div class=""> Seun</div><div class=""><br class=""></div></div><br class="">_______________________________________________<br class="">
Powered by <a href="http://www.kitware.com/" rel="noreferrer" target="_blank" class="">www.kitware.com</a><br class="">
<br class="">
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank" class="">http://www.kitware.com/opensource/opensource.html</a><br class="">
<br class="">
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank" class="">http://www.vtk.org/Wiki/VTK_FAQ</a><br class="">
<br class="">
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank" class="">http://markmail.org/search/?q=vtkusers</a><br class="">
<br class="">
Follow this link to subscribe/unsubscribe:<br class="">
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank" class="">http://public.kitware.com/mailman/listinfo/vtkusers</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>