Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2D Snapshot #179

Closed
dorodnic opened this issue Jun 13, 2018 · 7 comments
Closed

2D Snapshot #179

dorodnic opened this issue Jun 13, 2018 · 7 comments

Comments

@dorodnic
Copy link

Is there a way to get a single, fixed, 2D snapshot of the point-cloud?
I'm having some trouble embedding the IFrame created by plot in Google's Collaboratory - localhost refused to connect.
A static snapshot would help, even if it is not interactive.

@daavoo
Copy link
Owner

daavoo commented Jun 21, 2018

Hola @dorodnic!, thank you for commenting.

So there are lot of issues related with the IFrame based plotting method.

In #185 a new plotting backend with pythreejs was added.

Could you try this new plot method and see if it works for you on Google's Collaboratory???

@dorodnic
Copy link
Author

Hi @daavoo
Thank you for the response, I'm still trying to make it work...
Here is as far as I managed to get:

# fetch latest instead of pip install pyntcloud
!if [ ! -d "pyntcloud" ]; then git clone https://github.com/daavoo/pyntcloud.git; fi
!pip install pythreejs
from pyntcloud.pyntcloud import PyntCloud
# Get some "good" PLY from the web:
!wget https://github.com/daavoo/pyntcloud/raw/master/tests/data/diamond.ply
anky = PyntCloud.from_file("diamond.ply");
anky.plot(return_scene=True, backend="pythreejs");

But unfortunately the last line gets stuck and disconnects the runtime.
I'll update if I manage to figure it out. If you have example of using the new pythreejs backend, it looks exactly like what we need.

@daavoo
Copy link
Owner

daavoo commented Jul 15, 2018

@dorodnic It looks like that Google's collaboratory does not have support for ipython widgets (googlecolab/colabtools#60) wich makes the pythreejs backend fail.

We have recently added support for binder wich should serve as an alternative to Google's Colab ( without GPU). Could you try if binder serve as a solution for your needs??

I will try to add to pyntcloud an alternative static plottig backend (maybe matplotlib).

Regardless I hope that Google's Colab will add support for ipywidgets on soon.

@daavoo
Copy link
Owner

daavoo commented Jul 15, 2018

@dorodnic After launching binder you can find examples of the pythreejs backend and other functionalities under the examples folder

@dorodnic
Copy link
Author

Thank you for the suggestion, I will give it a try!

@dorodnic
Copy link
Author

It worked! Thank you 👍
Please consider adding some type of "static" backend, since dealing with widgets is somewhat of a headache.

@daavoo
Copy link
Owner

daavoo commented Aug 13, 2018

A static backend has been added in #215 using matplotlib.

It is quite slow and it requires you to set the elevation elev and azimuth azim angles in order to achieve the point of view you want. But it only requires matplotlib.

It supports the argument use_as_color and initial_point_size like the pythreejs backend:

cloud.plot(backend="matplotlib", use_as_color="x", elev=0, azim=90, initial_point_size=0.01)

@dorodnic I'm currently working on a http://vispy.org/ backend wich would be interactive but it works outside jupyter notebooks, not sure if that would be interesting for you.

Closing this, feel free to reopen if you consider that the issue has not been solved.

@daavoo daavoo closed this as completed Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants