Comments (7)
The color difference is caused by the fact the first time the rendering window does not yet exist, so vtkplotter makes it a default grey,
Okay, that explains the grey. Still it's a bit strange that the second screenshot is also grey, as the rendering window already existed in the second iteration.
Yeah, must be something in my environment which is clearly a bit strange. For example, despite it being a clean anaconda installation on a fresh MacOS, executing the same code above with ipython gives me a segfault (in the screenshot command). Without screenshot, the rendering window is not displayed. In any case I'll try to reproduce the problem on another system soon.
Thanks for the help and I'll write here if I find out anything new in case anyone else stumbles upon a similar problem :)
from vedo.
Hi again, I tried on my mac and YES, i can reproduce the issue! i´ll investigate that, thanks for spotting the issue, and get back to you asap.
from vedo.
Hi Marco,
nice, after updating to your new version I get the same output as you!
As your comment says, embedWindow(False)
is needed on ipython or jupyter. Also the normal python console seems to be fine with it.
Thanks a lot for following up on the issue!
Cheers,
Marvin
from vedo.
Hi @quakberto
thanks!
i cannot reproduce the problem.. are you running the latest version? try
pip install -U vtkplotter
Also, you cannot have a test_000 with i
in the range of [1,2,3].
This gives me the expected output:
from vtkplotter import Text, screenshot, Plotter
vp = Plotter(axes=0, interactive=0)
for i in [0,1,2,3]:
text = Text('%03d' %i, c='white')
vp += text
# vp += more objects..
vp.show()
screenshot('htest_%03d.png' %i)
vp.remove(text)
Let me know if it still does not work for you,
cheers
Marco
from vedo.
Hi Marco,
thanks for the quick look!
i cannot reproduce the problem.. are you running the latest version? try
pip install -U vtkplotter
Indeed I was one release behind, however the behaviour I get remains the same.
Your code gives me this output (I just increased the text size ...,s=10)
):
Also, you cannot have a test_000 with i in the range of [1,2,3].
Sorry, of course you're right, I meant test_002.png. Here's the output of the code I posted above:
Notice also the difference in text color.
Let me know if I can give you any info about my environment. In any case, I guess this could well be a problem outside of vtkplotter.
Cheers
from vedo.
that's funny... it must be something related to your python (?). In my ubuntu system with either python 2,3 your script gives the expected output.
Try maybe Text(str(i), c='white')
and screenshot(str(i)+'.png')
The color difference is caused by the fact the first time the rendering window does not yet exist, so vtkplotter makes it a default grey, This is fixed by explicitly setting c='white'
.
from vedo.
@quakberto
I think I fixed the issue... give it a try:
git clone https://github.com/marcomusy/vtkplotter.git
cd vtkplotter
pip install .
then:
from vtkplotter import *
#this is needed when using ipython or from jupyter:
#embedWindow(False)
vp = Plotter(axes=0, interactive=0)
for i in [1,2,3]:
text = Text('%03d' %i, c='white')
vp += text
vp += Sphere(c=i).x(i)
vp.show()
screenshot('test_%03d.png' %i)
vp.remove(text)
Let me know if the issue persists,
Cheers, M.
from vedo.
Related Issues (20)
- volume operation crashes HOT 2
- quadric decimation gone? HOT 1
- how to speed up cut_with_mesh? HOT 8
- example slab_vol.py crashes on AttributeError: 'Volume' object has no attribute 'slab' HOT 2
- collapse_edges() not preserving celldata HOT 2
- mesh colors not showing HOT 3
- distance_to produces error if the point cloud does not contain faces HOT 4
- Feature Request: mesh.show() to not permanently stay in plot HOT 2
- Vedo can not display point HOT 2
- Mesh intersect_with_line irregular processing time HOT 2
- Saving slice from volume.slice_plane() as array HOT 2
- How to add edges to join two detached meshes? HOT 13
- Abrupt termination when calling plotter.show HOT 2
- smooth shading HOT 3
- Lines.cmap maps to incorrect color when using `vtkLookupTable` as `input_cmap` HOT 3
- Behavior of `vedo.show` when called twice with different arguments HOT 1
- Error Thrown: Process finished with exit code -1073740791 (0xC0000409) HOT 8
- mesh modify doesnt change mesh pos() also GetPosition() not working HOT 7
- Feature requirement: Mesh decimation based on cell/point field HOT 1
- Decimating a mesh with islands results in missing cells
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vedo.