<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=ES link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><i><span lang=EN-US style='font-size:10.0pt;font-family:
"Courier New"'>Hello vtk world,<o:p></o:p></span></i></p>

<p class=MsoNormal><i><span lang=EN-US style='font-size:10.0pt;font-family:
"Courier New"'><o:p>&nbsp;</o:p></span></i></p>

<p class=MsoNormal><i><span lang=EN-US style='font-size:10.0pt;font-family:
"Courier New"'>Basically, what I'm currently trying to do is to cut a
vtkPolyData in two, using a loop of points. I'm using<o:p></o:p></span></i></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
color:#040004'>vtkImplicitSelectionLoop to create the loop, and vtkClipPolyData
to cut the vtkPolyData throughout the loop, which consists of a set of Points.
For simplicity, the point's Id have been selected using paraView, <o:p></o:p></span></p>

<pre><span lang=EN-US style='color:#040004'>that shouldn't be the problem. The problem is that the </span><span
lang=EN-US style='color:#040004'>output tends to be something like &quot; a big crescent shape chopped out of the 3D model or a whole bunch &nbsp;of tiny, irregularly&nbsp; shaped holes.&quot; As it has been mentioned in a previous mail touching the same subject, but there is no answer to this thread. ([vtkusers] Cutting a hole in polydata)<o:p></o:p></span></pre><pre><span
lang=EN-US style='color:#040004'>I also tried to cut it using vtkExtractPolyDataGeometry (also using the same implicitLoop), and the results were different, but still they weren't what I expected.<o:p></o:p></span></pre><pre><span
lang=EN-US style='color:#040004'><o:p>&nbsp;</o:p></span></pre><pre><span
lang=EN-US style='color:#040004'>here goes the code:<o:p></o:p></span></pre><pre><span
lang=EN-US style='color:#040004'><o:p>&nbsp;</o:p></span></pre>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:#040004'>vtkSmartPointer</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&lt;<span
style='color:#040004'>vtkImplicitSelectionLoop</span>&gt; <span
style='color:#040004'>loop</span> = <span style='color:#040004'>vtkImplicitSelectionLoop</span>::<span
style='color:#040004'>New</span>();<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:green'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:green'>// The following
points have been selected using ParaView from the aneurysm_with_vessels
polyData<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:blue'>int</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span
style='color:#040004'>myints</span>[] = {5275,
4761,4520,4591,3314,1381,1037,718,574,905,2512,4099,4854,5521,5286,5274 };<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:#040004'>vector</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&lt;<span
style='color:blue'>int</span>&gt; <span style='color:#040004'>ids</span> (<span
style='color:#040004'>myints</span>, <span style='color:#040004'>myints</span>
+ <span style='color:blue'>sizeof</span>(<span style='color:#040004'>myints</span>)
/ <span style='color:blue'>sizeof</span>(<span style='color:blue'>int</span>)
);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:#040004'>vtkSmartPointer</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&lt;<span
style='color:#040004'>vtkPoints</span> &gt; <span style='color:#040004'>paraViewPoints</span>
= <span style='color:#040004'>vtkPoints</span>::<span style='color:#040004'>New</span>();<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:blue'>for</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>( <span
style='color:blue'>int</span> <span style='color:#040004'>i</span> = 0; <span
style='color:#040004'>i</span> &lt; <span style='color:#040004'>ids</span>.<span
style='color:#040004'>size</span>(); <span style='color:#040004'>i</span>++ )<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New"'>{<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp; <span
style='color:#040004'>paraViewPoints</span>-&gt;<span style='color:#040004'>InsertPoint</span>(<span
style='color:#040004'>i</span>,<span style='color:#040004'>inputMesh</span>-&gt;<span
style='color:#040004'>GetPoint</span>(<span style='color:#040004'>ids</span>.<span
style='color:#040004'>at</span>(<span style='color:#040004'>i</span>)));<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:#040004'>}<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:#040004'>loop</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>-&gt;<span
style='color:#040004'>SetLoop</span>(<span style='color:#040004'>paraViewPoints</span>);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:green'>//clip polygonal
data with user-specified implicit function </span><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:#040004'>vtkSmartPointer</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&lt;<span
style='color:#040004'>vtkClipPolyData</span>&gt; <span style='color:#040004'>clipper</span>
= <span style='color:#040004'>vtkClipPolyData</span>::<span style='color:#040004'>New</span>();<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:#040004'>clipper</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>-&gt;<span
style='color:#040004'>SetInput</span>(<span style='color:#040004'>inputMesh</span>);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:#040004'>clipper</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>-&gt;<span
style='color:#040004'>SetClipFunction</span>( <span style='color:#040004'>loop</span>
);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:#040004'>clipper</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>-&gt;<span
style='color:#040004'>Update</span>();<o:p></o:p></span></p>

<pre><span lang=EN-US style='color:#040004'>vtkPolyData</span><span lang=EN-US>* <span
style='color:#040004'>clippedOutput</span> = <span style='color:#040004'>clipper</span>-&gt;<span
style='color:#040004'>GetOutput</span>();<o:p></o:p></span></pre><pre><span
lang=EN-US><o:p>&nbsp;</o:p></span></pre><pre><span lang=EN-US>Thanks in advance!<o:p></o:p></span></pre><pre><span
lang=EN-US><o:p>&nbsp;</o:p></span></pre><pre><span lang=EN-US>Regards,<o:p></o:p></span></pre><pre><span
lang=EN-US><o:p>&nbsp;</o:p></span></pre><pre><span lang=EN-US>Martin.</span><span
lang=EN-US style='color:#040004'><o:p></o:p></span></pre><pre><i><span
lang=EN-US><o:p>&nbsp;</o:p></span></i></pre>

<p class=MsoNormal><i><span lang=EN-US style='font-size:10.0pt;font-family:
"Courier New"'><o:p>&nbsp;</o:p></span></i></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

</div>

</body>

</html>