-
Notifications
You must be signed in to change notification settings - Fork 4
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
Volume from polydata (point cloud) #125
Comments
o.k got the solution (I had used interpolate incorrectly): import numpy as np
import pyvista as pv
from pyvista import examples
import panel as pn
pn.extension('vtk')
import os
os.environ["DISPLAY"] = ":99.0"
os.system('Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &')
grid = pv.UniformGrid()
grid.dimensions = (10, 10, 10)
grid.origin = (0, 0, 0)
grid.spacing = (1, 1, 1)
vertices = np.array([[0, 0, 3], [2, 0, 0], [5, 2, 0], [0, 3, 4]])
data = pv.PolyData(vertices)
data.point_arrays["values"] = [0.1, 0.5, 0.3, 0.8]
igrid = grid.interpolate(points=data, pass_point_arrays=True, dimensions=(10, 10, 10), radius=1)
volume = pn.panel(igrid, sizing_mode='stretch_both', height=400, display_slices=True)
pn.Row(volume.controls(jslink=True), volume) But what is the most sensible way to update the values? So that I have a callback that I can use with ipywidget / panel to update the plot. |
I too don't really like @banesullivan, your thoughts? |
@quaeritis, thanks for posting your solution here so that others can later find and learn from it! As for Slack... I personally like Slack a lot and I'm active in over 10 workspaces, so its the place to find me... Slack with channels, integrations, markdown formatting are great and it's base features (all that we would need) are free. Very tough sell to move me towards Gitter, but I'm happy to let folks know we have it... however, we should caution to fragment our presence/communities online as that could really hinder how new users/contributors receive support/get involved. As for using a social messaging platform for support (whether it is Gitter or Slack), I'm generally not in favor of that. I'd really like to see this support "forum" take off as it is seamless to link changes in the codebase to support tickets and all of these support topics are permanently archived with tags, well-formatted code, and a really powerful search engine built into GitHub. So that way when a new issue opens up, we can easily find similar issues and give the new user a clean way to find materials related to their topics. Having a new user search through Gitter or Slack's message threads is not ideal. In summary: Support topics and any knowledge about PyVista should be on GitHub (either this support repo or the main PyVista repo) and social messages on Gitter/Slack should be for banter, project management/logistics nonsense, sharing cool links/demos, connecting with folks to start a new project, or one-off support items like "how do I install this package and make a sphere". |
Also, @quaeritis, I see you are using a from itkwidgets import view
view(image=igrid) |
And...... our Perhaps this example interpolation workflow would interest you: GeoStat-Framework/GSTools#36 (comment) |
Hello @banesullivan, I can easily render the So would you still be open to creating a Gitter room? Would you put it on or would someone else have to do it? (I do not know if this can be done without rights, if so I can do that.) I can understand your concerns about communication fragmentation. I can also understand your other explanations regarding the disadvantages of a chat for support. Another question from me is still where is the project delimitation between pyvista and PVGeo both offer e.g. filters? I think some of the PVGeo functions are general plot functions independent of geo sciences. Please don't get me wrong, I think your project is great here. I just think that many potential users don't use the great tools that PVGeo offers because they think it's primarily for the geo sciences. (sorry for my bad English) |
Ich habe ein "Gitter Room" gemacht: https://gitter.im/pyvista/community# As for @banesullivan will have to reply about the difference with Also, your english is great. I lived in Germany for some time and I have a lot of respect for those who have to regularly converse in another language. |
As @akaszynski mentioned, we have a Gitter room (at least I'm guessing that's what that german states). If the PyVista community wants Gitter, I'm all for it! I want the users/community to drive the decisions, so if the Gitter gets more traction than Slack, then we can re-evaluate this and perhaps migrate to Gitter in the spirit of openness. In the meantime, I really like Slack and you all can find me on there 😉
You bring up some great points about PVGeo. It has been tough to draw a line for what should be in PVGeo vs PyVista. I believe that I am heading towards having PVGeo be a file IO module for geoscience formats and moving most of the filters over to PyVista. The thing is, some of those custom filters in PVGeo that aren't necessarily geoscientific do not all make sense to include in PyVista as we are trying to keep PyVista lean and clean as a pure interface back to VTK. Merging the two projects would produce quite a bit of maintenance overhead that I don't want to push on the other developers of PyVista, so... PVGeo has become an orphan of PyVista with some neat features that not many folks know about or are willing to try because it has some heavy dependencies and is marketed towards geoscientists. In time, I hope to completely refactor PVGeo into a more useable Python module less focused on ParaView plugins. Perhaps then, I can migrate filters to PyVsita that make sense to be in PyVista and leave PVGeo as a file IO extension package to PyVista. and then maybe make an offshoot project that handles all the ParaView plugins totally separate by wrapping both PVGeo and PyVista filters. Some other points:
|
Description
Hi, I would like to render a volume from a point cloud (polydata).
I thought
pv.DataSetFilters.interpolate
would be the right one for this. To get apyvista.UniformGrid
which I can then plot withpn.panel (grid, sizing_mode =' stretch_both ', height = 400, display_slices = True)
in jupyterlab. Unfortunately I only get anpolydata
object frominterpolate
.I am currently using
vtkplotter.interpolateToVolume
but would like to switch to pyvista.An update of the scalar values would also be very practical. I think this should be possible with the panel vtk plot.
Example Data
My starting point are numpy arrays with points and associated scalar values:
How do I get a
UniformGrid
from this I can plot as avtkVolume
Other topic:
A Gitter for support would also be helpful, I think. slack is an unsightly solution (proprietary software). But the most important point is that an additional registration is necessary. Gitter can easily be used with the Github acc.
If you google a little you will find numerous articles that explain why Slack is absolutely unsuitable for open source communications here and here.
Gitter is just my suggestion but basically anything that is open source (irc, Mattermost, ...) is better than Slack.
The text was updated successfully, but these errors were encountered: