[vtk-developers] Bug with vtkCellLocator and VTK_VERTEX cells

Biddiscombe, John A. biddisco at cscs.ch
Wed Aug 28 03:57:54 EDT 2013


You might want to try 

  18 // .NAME vtkParticleBoxTree - Special BSP tree for particles with no size
  19 //
  20 // .SECTION Description
  21 // vtkParticleBoxTree is a BSP tree which takes particle data and
  22 // assumes a box size for each particle. The box size is either fixed
  23 // for all particles, or if supplied, a support radius with one entry
  24 // per particle can be used. Raytracing of simple points would 
  25 // normally produce no output, using this BSP tree enables a finite 
  26 // volume to be assigned to each particle and permits raycasting 
  27 // operations to be performed on them.

https://hpcforge.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=pv-meshless/pv-meshless.git;a=blob;f=vtkParticleBoxTree.h;h=dffa739539bc3971c86d43cb9ba28c8eb8ea8cb2;hb=HEAD

I need to change this to use vtkCellTreeLocator as a base class to save memory as the ModifiedBSPTree uses way too much and it's mostly redundant in this case anyway.

JB


> -----Original Message-----
> From: vtk-developers-bounces at vtk.org [mailto:vtk-developers-
> bounces at vtk.org] On Behalf Of David Thompson
> Sent: 27 August 2013 21:17
> To: VTK Developers
> Subject: [vtk-developers] Bug with vtkCellLocator and VTK_VERTEX cells
> 
> Hi all,
> 
> I've run into some trouble in vtkCellLocator's implementation of
> IntersectWithLine() when running on a dataset composed almost entirely of
> VTK_VERTEX cells. The problem appears to be an overly-aggressive
> optimization. Around line 284 of vtkCellLocator.cxx, each cell in an octant of
> the locator has its bounds intersected with the test ray *without a tolerance*
> before the cell is extracted and its IntersectWithLine() method is called. This
> is a problem since VTK_VERTEX bounds are degenerate and very unlikely to
> intersect the test line.
> 
> There are several possible fixes:
> 
> 1. Don't do that (call IntersectWithLine on point clouds). If we aren't
> supposed to use the cell locator with vertex cells, should we add an
> IntersectWithLine method to vtkPointLocator?
> 
> 2. Avoid using vtkCell. We could use static geometric helpers for certain
> simple cell types like points and triangles, bypassing the whole bounding box
> and vtkCell::IntersectWithLine() tests.
> 
> 3. Fix the optimization.
> 
>   a. We can always just tweaking the bounding boxes by the tolerance before
> running the intersection test. This works for me but I didn't do the same for
> the CacheCellBounds case which is tricky since a different tolerance might be
> used for successive queries and copying the bounds eliminates some benefit
> of caching them.
> 
>   b. Add a method to test box-line intersection that takes a tolerance.
> 
> Any ideas on which fix is the best? Is there some better way to pick 3-D
> points from a 2-D rendering than firing a ray with
> vtkCellLocator::IntersectWithLine?
> 
> 	Thanks,
> 	David
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers




More information about the vtk-developers mailing list