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

Pyvista Boolean Operations Issues #3290

Open
harshamarupudi56 opened this issue Sep 9, 2022 · 3 comments
Open

Pyvista Boolean Operations Issues #3290

harshamarupudi56 opened this issue Sep 9, 2022 · 3 comments
Labels
bug Uh-oh! Something isn't working as expected.

Comments

@harshamarupudi56
Copy link

Describe the bug, what's wrong, and what you expected.

I was working with boolean difference between two objects generated in pyvista. This code was initially working no problem but now I am getting this error message

ERROR:root:No points to subdivide
2022-09-09 09:32:58.572 ( 968.692s) [        3E66A0C0]    vtkPointLocator.cxx:845    ERR| vtkPointLocator (0x55930b345a40): No points to subdivide
2022-09-09 09:32:58.574 ( 968.693s) [        3E66A0C0]vtkIntersectionPolyData:2410  WARN| No Intersection between objects 
2022-09-09 09:32:58.618 ( 968.737s) [        3E66A0C0]vtkDistancePolyDataFilt:81     ERR| vtkDistancePolyDataFilter (0x55930b5195f0): No points/cells to operate on
ERROR:root:No points/cells to operate on
ERROR:root:No points/cells to operate on
2022-09-09 09:32:58.619 ( 968.738s) [        3E66A0C0]vtkDistancePolyDataFilt:81     ERR| vtkDistancePolyDataFilter (0x55930b5195f0): No points/cells to operate on
Traceback (most recent call last):

  File "/gpfs_projects_old/sriharsha.marupudi/mesh_union.py", line 45, in <module>
    result.plot(color='tan')

  File "/gpfs_projects/sriharsha.marupudi/anaconda3/lib/python3.9/site-packages/pyvista/plotting/helpers.py", line 241, in plot
    plotter.add_mesh(var_item, **kwargs)

  File "/gpfs_projects/sriharsha.marupudi/anaconda3/lib/python3.9/site-packages/pyvista/plotting/plotting.py", line 2183, in add_mesh
    raise ValueError('Empty meshes cannot be plotted. Input mesh has zero points.')

ValueError: Empty meshes cannot be plotted. Input mesh has zero points.

I had done nothing to change this code from the example in the docs and it has worked previously.

Steps to reproduce the bug.

cube = pv.Cube().triangulate().subdivide(3)
sphere = pv.Sphere(radius=0.6)
result = cube.boolean_difference(sphere)
result.plot(color='tan')

System Information

Qt WebEngine seems to be initialized from a plugin. Please set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute before constructing QGuiApplication.

--------------------------------------------------------------------------------
  Date: Fri Sep 09 09:56:07 2022 EDT

                OS : Linux
            CPU(s) : 32
           Machine : x86_64
      Architecture : 64bit
               RAM : 62.8 GiB
       Environment : IPython
       File system : ext4
        GPU Vendor : VMware, Inc.
      GPU Renderer : llvmpipe (LLVM 10.0.0, 128 bits)
       GPU Version : 3.3 (Core Profile) Mesa 20.0.8

  Python 3.9.7 (default, Sep 16 2021, 13:09:58)  [GCC 7.5.0]

           pyvista : 0.34.0
               vtk : 9.1.0
             numpy : 1.21.5
           imageio : 2.19.3
           appdirs : 1.4.4
            scooby : 0.5.12
        matplotlib : 3.5.1
             PyQt5 : 5.9.2
           IPython : 7.31.1
          colorcet : 3.0.0
             scipy : 1.7.3
              tqdm : 4.64.0
            meshio : 5.3.4

  Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904
  for Intel(R) 64 architecture applications
--------------------------------------------------------------------------------

Screenshots

No response

@harshamarupudi56 harshamarupudi56 added the bug Uh-oh! Something isn't working as expected. label Sep 9, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2022

Hi and welcome! Thanks for posting your first issue in the PyVista project! Someone from @pyvista/developers will chime in before too long. If your question is support related, we may transfer it to the Discussions.

@adeak
Copy link
Member

adeak commented Sep 11, 2022

I can't reproduce this issue on a similar setup:

--------------------------------------------------------------------------------
  Date: Sun Sep 11 23:51:21 2022 CEST

                OS : Linux
            CPU(s) : 8
           Machine : x86_64
      Architecture : 64bit
               RAM : 15.5 GB
       Environment : Python
        GPU Vendor : Intel
      GPU Renderer : Mesa Intel(R) UHD Graphics 620 (WHL GT2)
       GPU Version : 4.6 (Core Profile) Mesa 20.3.5

  Python 3.9.2 (default, Feb 28 2021, 17:03:44)  [GCC 10.2.1 20210110]

           pyvista : 0.34.0
               vtk : 9.1.0
             numpy : 1.23.0
           imageio : 2.21.2
           appdirs : 1.4.4
            scooby : 0.5.6
        matplotlib : 3.5.3
           IPython : 8.4.0
          colorcet : 3.0.0
           cmocean : 2.0
        ipyvtklink : 0.2.2
             scipy : 1.9.1
        itkwidgets : 0.32.2
              tqdm : 4.64.1
            meshio : 5.3.4
--------------------------------------------------------------------------------

The complete snippet I used:

import pyvista as pv

cube = pv.Cube().triangulate().subdivide(3)
sphere = pv.Sphere(radius=0.6)
result = cube.boolean_difference(sphere)
result.plot(color='tan')

Can you say something more about what you're doing? Your report says "IPython": are you repeatedly running these lines as a single cell? Or running a script via %run? Something else?

And when you say it "was initially working", are you sure nothing changed in the script, or in the environment? Have you restarted IPython to see if the problem remains?

@harshamarupudi56
Copy link
Author

Hello sorry for the late response.

I am running the script in Spyder not sure why it is saying iPython. I have restarted spyder, and the environment. So what appears to be happening is when I try to run this line of code in a new script I do not have this issue.

But when I run this code in a previously saved script I return the error message that had appeared above. I had had read about issues with repeated calling of boolean causing failure.

pyvista/pyvista-support#447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Uh-oh! Something isn't working as expected.
Projects
None yet
Development

No branches or pull requests

2 participants