[vtkusers] Nonrectangular selection of points (vertices) or cells (triangles) on a mesh surface (paraview like)

Berti Krüger berti_krueger at hotmail.com
Sun Sep 23 00:51:13 EDT 2018


Thanks David for all the help and your hints. This really helped me a lot.


The example code really showcases the ParaView's polygon selection feature as it is used in Paraview and how to extract the subset surface.


Additionally with the vtkHardwareSelector i was also able to use the vtkContourWidget for drawing a polygon on the mesh and using the enclosed surface area for selection.


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 enclosed by the polygon with the vtkDelaunay2D filter.


I then extruded the resulting vtkPolyData:


[cid:6ce71f7e-74c7-47e8-bd94-b3a730c6619b]


Can this be done easier / better?
(So far i am content. But as i have read in other threads the vtkDelaunay2D filter has issues regarding stability and could hang.)


The vtkHardwareSelector 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.).

Are there any alternatives to the vtkHardwareSelector for this kind of application?


Thank you very much again for the effort.


Kind regards,

Berti
________________________________
Von: David E DeMarle <dave.demarle at kitware.com>
Gesendet: Freitag, 7. September 2018 12:37
An: Berti Krüger
Cc: vtkusers at vtk.org
Betreff: Re: [vtkusers] Nonrectangular selection of points (vertices) or cells (triangles) on a mesh surface (paraview like)

Hello,

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.

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.

David E DeMarle
Kitware, Inc.
Principal Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Fri, Sep 7, 2018 at 5:12 AM Berti Krüger <berti_krueger at hotmail.com<mailto:berti_krueger at hotmail.com>> wrote:

Hello everyone.

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:

[cid:6bce5125-0cf4-43a0-962c-cc9dd5a593f1]

[cid:dc6cff08-ee3c-4c70-bea2-9e44a8578c05]


Paraview has a similiar feature called "select points with polygon" or "select cells with polygon":


[cid:4238abb5-92ec-41d2-a435-867a45d1a7cb]


At the end of the process i want to create a polygon mesh which has the shape of the vtkContourWidget polygon selection contour line and which lies like a sticker or texture on the the given stl mesh surface.


If anybody can help me with ideas / suggestions / hints / pointers on how to accomplish this with vtk i would be glad.



Thank you very much in advance,


Berti


_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180923/8afea0be/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extrusion.jpg
Type: image/jpeg
Size: 238088 bytes
Desc: extrusion.jpg
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180923/8afea0be/attachment-0001.jpg>


More information about the vtkusers mailing list