<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Thanks David for all the help and your hints. This really helped me a lot.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">The example code really showcases the ParaView's polygon selection feature as it is used in Paraview and how to extract the subset surface.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Additionally with the <span>vtkHardwareSelector i was also able to use the <span>vtkContourWidget</span></span> for drawing a polygon on the mesh and using the enclosed surface area for selection. </p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I then reconstructed the enclosed surface by using the points of the polygon itself and the points of the original mesh which lie inside the surface area
<span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
enclosed by the polygon </span>with the <span>vtkDelaunay2D filter.</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span>I then extruded the resulting vtkPolyData: </span></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><img size="238088" contenttype="image/jpeg" id="img572030" tabindex="0" style="max-width: 99.9%; user-select: none;" data-outlook-trace="F:1|T:1" src="cid:6ce71f7e-74c7-47e8-bd94-b3a730c6619b"><br>
<br>
</p>
<b>Can this be done easier / better? </b>
<div>(So far i am content. But as i have read in other threads the <span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">vtkDelaunay2D
 filter has issues regarding stability and could hang.)</span>
<div><br>
</div>
<div><br>
</div>
<div>The <span>vtkHardwareSelector</span> is damn fast but has limitations because of the way it works (e.g. it doesn't work with wireframe representation, opacity, multisampling, selects only the directly visible geometry etc.). </div>
<div><br>
</div>
<div><b>Are there any alternatives to the vtkHardwareSelector for this kind of application? </b><br>
<br>
<br>
Thank you very much again for the effort.</div>
<div><br>
</div>
<div><br>
</div>
<div>Kind regards,</div>
<div><br>
</div>
<div>Berti<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> David E DeMarle <dave.demarle@kitware.com><br>
<b>Gesendet:</b> Freitag, 7. September 2018 12:37<br>
<b>An:</b> Berti Krüger<br>
<b>Cc:</b> vtkusers@vtk.org<br>
<b>Betreff:</b> Re: [vtkusers] Nonrectangular selection of points (vertices) or cells (triangles) on a mesh surface (paraview like)</font>
<div> </div>
</div>
<meta content="text/html; charset=utf-8">
<div>
<div dir="ltr">Hello,
<div><br>
</div>
<div>The VTK level implementation behind ParaView's polygon selection feature is exercised/demonstrated by Rendering/Core/Testing/Cxx/TestPolygonSelection.cxx. You can follow that to see how a VTK enabled app can make a non rectangular selection.</div>
<div><br>
</div>
<div>With that selection you might either extract a subset surface offset it a bit and change the appearance, or use the preserve topology feature of selection to make a shallow copy of the original mesh with a new array that identifies the selected primitives,
 and use that array as input to the coloration of the whole to modify its appearance.</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>David E DeMarle<br>
Kitware, Inc.<br>
Principal Engineer<br>
21 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: 518-881-4909</div>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr">On Fri, Sep 7, 2018 at 5:12 AM Berti Krüger <<a href="mailto:berti_krueger@hotmail.com" id="LPlnk678820" class="OWAAutoLink" previewremoved="true">berti_krueger@hotmail.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div id="x_m_2009363084587880724divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0"></p>
<div style="font-family:-webkit-standard">Hello everyone.</div>
<div style="font-family:-webkit-standard"><br>
</div>
<div style="font-family:-webkit-standard">In my project i have a standard 3D STL triangle surface mesh where i need to select all vertices which lie inside a region (polygon) defined by a closed polyline created by an user interaction using the vtkContourWidget:</div>
<div style="font-family:-webkit-standard"><br>
</div>
<div style="font-family:-webkit-standard"><img size="968853" id="x_m_2009363084587880724img962865" style="max-width: 99.9%; user-select: none;" data-outlook-trace="F:0|T:1" src="cid:6bce5125-0cf4-43a0-962c-cc9dd5a593f1"><br>
<br>
</div>
<img size="983210" id="x_m_2009363084587880724img494385" style="max-width: 99.9%; user-select: none;" data-outlook-trace="F:0|T:1" src="cid:dc6cff08-ee3c-4c70-bea2-9e44a8578c05"><br>
<br>
<p></p>
<p style="margin-top:0; margin-bottom:0">Paraview has a similiar feature called <i>
<b>"select points with polygon" </b></i>or <b><i>"select cells with polygon"</i></b>:</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"><img size="295118" id="x_m_2009363084587880724img595248" style="max-width: 99.9%; user-select: none;" data-outlook-trace="F:0|T:1" src="cid:4238abb5-92ec-41d2-a435-867a45d1a7cb"><br>
<br>
</p>
<p style="margin-top:0; margin-bottom:0">At the end of the process i want to create a polygon mesh which has the shape of the <span style="font-size:16px">vtkContourWidget polygon selection contour line and</span> which lies like a sticker or texture on the
 the given stl mesh surface.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">If anybody can help me with ideas / suggestions / hints / pointers on how to accomplish this with vtk i would be glad.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Thank you very much in advance,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Berti</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
</div>
</div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank" id="LPlnk985260" class="OWAAutoLink" previewremoved="true">
www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank" id="LPlnk138837" class="OWAAutoLink" previewremoved="true">
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" rel="noreferrer" target="_blank" id="LPlnk242696" class="OWAAutoLink" previewremoved="true">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank" id="LPlnk902446" class="OWAAutoLink" previewremoved="true">
http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank" id="LPlnk68958" class="OWAAutoLink" previewremoved="true">https://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>