Pyvista: Raytrace Not Functioning Properly

Created on 2 Oct 2020  路  5Comments  路  Source: pyvista/pyvista

Description:

I'm having an issue where I'm generating a bunch of similar shaped meshes (similar in shape to a flattened sphere) and using the ray trace function to calculate an intersection point with a ray that starts ar a point inside the shape and ends outside it. For some of these meshes the ray trace function returns 0 points even through its clear when you plot the mesh and the ray line that there is an intersection point. I've included the code below and a zipped .stl file of the mesh in question. I would appreciate if you could look into this and let me know if its a bug in the function or if I've done something incorrect. Thanks.

mesh.zip


To Reproduce

import pyvista as pv
mesh = pv.read('mesh.stl')
start = [0,0,0]
stop = [54857, -1.78419e+06, -21443.4]
point, cell = mesh.ray_trace(start, stop, first_point=True)
ray = pv.Line(start, stop)
p = pv.Plotter(notebook=False)
p.add_mesh(mesh, show_edges=True, opacity=0.5, color="w")
p.add_mesh(ray, color="blue", line_width=3)
p.show()

Screenshots
If applicable, add screenshots to help explain your problem.


System Information:

--------------------------------------------------------------------------------
  Date: Fri Oct 02 09:09:45 2020 Eastern Daylight Time

                OS : Windows
            CPU(s) : 8
           Machine : AMD64
      Architecture : 64bit
               RAM : 31.9 GB
       Environment : Jupyter
        GPU Vendor : NVIDIA Corporation
      GPU Renderer : Quadro M1200/PCIe/SSE2
       GPU Version : 4.5.0 NVIDIA 431.02

  Python 3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]

           pyvista : 0.25.3
               vtk : 9.0.1
             numpy : 1.18.5
           imageio : 2.8.0
           appdirs : 1.4.3
            scooby : 0.5.5
            meshio : 4.0.15
        matplotlib : 3.2.2
             PyQt5 : 5.9.2
           IPython : 7.15.0
             scipy : 1.5.0
              tqdm : 4.46.1

  Intel(R) Math Kernel Library Version 2020.0.1 Product Build 20200208 for
  Intel(R) 64 architecture applications
--------------------------------------------------------------------------------

vtk-issue

All 5 comments

I'm not seeing any problems with your implementation, and I'm having trouble getting any intersections to compute on your mesh. I think there might be a problem with the underlying implementation within VTK.

I'm not really sure how to report this bug as I'm not familiar enough with the vtk library to reproduce the issue not using pyvista. Any suggestions?

We can make a minimal example and post an issue in VTK. Odds are it'll be a long time before it catches traction though...

Closing as this not applicable to pyvista.

@deyanimay, please follow up on https://gitlab.kitware.com/vtk/vtk/-/issues/18031

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JiaweiZhuang picture JiaweiZhuang  路  6Comments

tkoyama010 picture tkoyama010  路  3Comments

dennissergeev picture dennissergeev  路  5Comments

cweickhmann picture cweickhmann  路  5Comments

rodrigomologni picture rodrigomologni  路  4Comments