[vtkusers] VTK rendering 2D mesh

kenichiro yoshimi rccm.kyoshimi at gmail.com
Sun Jun 17 23:19:26 EDT 2018


Hello mafiaskafia,

You can render the wireframe edges of the mesh and set color of them
in the following way.
---
    colors = vtk.vtkNamedColors()

    #Create an actor
    MeshActor = vtk.vtkActor()
    MeshActor.SetMapper(MeshMapper)
    MeshActor.GetProperty().EdgeVisibilityOn()
    MeshActor.GetProperty().SetEdgeColor(colors.GetColor3d("White"))
---

Best

2018-06-18 7:41 GMT+09:00 mafiaskafia <tsilveira1993 at gmail.com>:
> Hello, so i'm trying to render a 2D mesh using vtk (in python). I have a list
> of tuples containing all the points and also a list of tuples containing the
> points of each cell. Just to experiment, I tried to create a polydata object
> of a square with 4 elements and render it, but i ended up with this:
>
> <http://vtk.1045678.n5.nabble.com/file/t342418/helpp.png>
>
> I would like it to show the lines connecting the nodes (like a wireframe)
> instead of solid square..
> This is the code to produce the image above:  code example
> <https://pastebin.com/uik9uDQk>
>
> I would also like to know if it's possible to have a gridline as the
> background of the render window, instead of a black color, just like this:
>
> <http://vtk.1045678.n5.nabble.com/file/t342418/helpaa.png>
>
>
>
>
>
>
>
> --
> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
> _______________________________________________
> Powered by 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


More information about the vtkusers mailing list