Gridline as the background in VTK (Python)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Gridline as the background in VTK (Python)

mafiaskafia
Hello, I would like to know if it's possible to have a gridline as the
background of the vtkRenderer (instead of a blank color) like this:
  <http://vtk.1045678.n5.nabble.com/file/t342418/halpaa.png> .
I'm doing a program that does a 2D cross-section analysis using FEM (gives
its centroid, inertias, etc), so i would need a gridline to display, for
example, the centroids more efficiently. Is this possible with vtk?

Thanks in advance,

Cheers



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Gridline as the background in VTK (Python)

Slaughter, Andrew E
Here is a script that builds an empty plot, this should be a good starting point.

#!/usr/bin/env python
import vtk

chart = vtk.vtkChartXY()
plot = vtk.vtkPlotPoints()
chart.AddPlot(plot)

view = vtk.vtkContextActor()
view.GetScene().AddItem(chart)

renderer = vtk.vtkRenderer()
renderer.AddActor(view)
renderer.SetBackground(0.5,0.5,0.5)

window = vtk.vtkRenderWindow()
window.SetSize(500, 500)
window.AddRenderer(renderer)

interactor = vtk.vtkRenderWindowInteractor()
interactor.SetRenderWindow(window)
interactor.Initialize()

window.Render()
interactor.Start()

On Tue, Jun 26, 2018 at 10:04 AM, mafiaskafia <[hidden email]> wrote:
Hello, I would like to know if it's possible to have a gridline as the
background of the vtkRenderer (instead of a blank color) like this:
  <https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_file_t342418_halpaa.png&d=DwICAg&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=oXz2Jh2vN4kLzvKkknrbCJz0YhnBRGhw5Oytmjuqv4Q&s=TLZky1NKFTXcRhpwzuI0rtCdYor9i-XOTRQT_tXZTls&e=> .
I'm doing a program that does a 2D cross-section analysis using FEM (gives
its centroid, inertias, etc), so i would need a gridline to display, for
example, the centroids more efficiently. Is this possible with vtk?

Thanks in advance,

Cheers



--
Sent from: https://urldefense.proofpoint.com/v2/url?u=http-3A__vtk.1045678.n5.nabble.com_VTK-2DUsers-2Df1224199.html&d=DwICAg&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=oXz2Jh2vN4kLzvKkknrbCJz0YhnBRGhw5Oytmjuqv4Q&s=vqQZY9HpqApGkjO-xUu9-bSVQyT9CuBb_nbJGELav54&e=
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_opensource_opensource.html&d=DwICAg&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=oXz2Jh2vN4kLzvKkknrbCJz0YhnBRGhw5Oytmjuqv4Q&s=bm9lMiY6joExtUXYwzqpu7xPGz7LiO51nameV0Yj-iQ&e=

Please keep messages on-topic and check the VTK FAQ at: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.vtk.org_Wiki_VTK-5FFAQ&d=DwICAg&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=oXz2Jh2vN4kLzvKkknrbCJz0YhnBRGhw5Oytmjuqv4Q&s=udQgCHTjRSQUvCf1nmOocbHzgTS2Z5EB13hWSWkydnE&e=

Search the list archives at: https://urldefense.proofpoint.com/v2/url?u=http-3A__markmail.org_search_-3Fq-3Dvtkusers&d=DwICAg&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=oXz2Jh2vN4kLzvKkknrbCJz0YhnBRGhw5Oytmjuqv4Q&s=ojtBttbLzoXPQuYZStnqlpuBAJhO_tK3LH4yON5Fn10&e=

Follow this link to subscribe/unsubscribe:
https://urldefense.proofpoint.com/v2/url?u=https-3A__public.kitware.com_mailman_listinfo_vtkusers&d=DwICAg&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=oXz2Jh2vN4kLzvKkknrbCJz0YhnBRGhw5Oytmjuqv4Q&s=qH_Xrf6LTnD1ebDxNhFzLVSD_n-BF-4pJOHa1Z6uOTk&e=


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Gridline as the background in VTK (Python)

mafiaskafia
Thank you! Altough i need to make some adjustments



--
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