Skip to content

Commit

Permalink
New extrusion filter extrudes to trim surface
Browse files Browse the repository at this point in the history
This filter extrudes a generating polydata until it intersects
a trim surface. Two inputs are required: the input generating
polydata and the trim surface (also polydata). Options exist
to control the capping process to produce the end cap at the average
intersection distance, maximum intersection distance, minimum
intersection distance, and as intersected.

Further, vtkStaticCellLocator was not thread safe in its line
intersection method, and the locator was not intersecting cells
properly in all cases. The bin - line intersection traversal
algorithm was confusing and non-optimal. Hence the commit
also includes a rewrite of the intersection code to be thread
safe and to use a more efficient bin/voxel traversal method.
  • Loading branch information
wschroed committed Jan 8, 2018
1 parent cceb1b8 commit a007b93
Show file tree
Hide file tree
Showing 21 changed files with 1,431 additions and 251 deletions.
7 changes: 3 additions & 4 deletions Common/DataModel/vtkAbstractCellLocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class VTKCOMMONDATAMODEL_EXPORT vtkAbstractCellLocator : public vtkLocator

/**
* Return intersection point (if any) AND the cell which was intersected by
* the finite line. The cell is returned as a cell id and as a generic cell.
* the finite line. The cell is returned as a cell id and as a generic
* cell.
*/
virtual int IntersectWithLine(
double p1[3], double p2[3], double tol, double& t, double x[3],
Expand All @@ -145,7 +146,7 @@ class VTKCOMMONDATAMODEL_EXPORT vtkAbstractCellLocator : public vtkLocator
* lies outside the closed surface.
* Either 'points' or 'cellIds' can be set to nullptr if you don't want
* to receive that information. This method is currently only implemented
* in vtkOBBTree
* in vtkOBBTree.
*/
virtual int IntersectWithLine(
const double p1[3], const double p2[3],
Expand Down Expand Up @@ -300,5 +301,3 @@ class VTKCOMMONDATAMODEL_EXPORT vtkAbstractCellLocator : public vtkLocator
};

#endif


11 changes: 10 additions & 1 deletion Common/DataModel/vtkCellLocator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,16 @@ void vtkCellLocator::ComputeOctantBounds(int i, int j, int k)

//----------------------------------------------------------------------------
// Return intersection point (if any) AND the cell which was intersected by
// finite line
// finite line.
//
// NOTE: This method is not thread safe (i.e., when invoking this method on
// the same instance of vtkCellLocator). This is the due to the use of the
// data members QueryNumber and CellHasBeenVisited. These should be pulled
// out of the class and made local to the appropriate methods that use
// them. Since there may be a performance cost and possible effects on
// output, this will be done TODO when more time is available. To see an
// alternative implementation, see vtkStaticCellLocator which is thread safe.
//
int vtkCellLocator::IntersectWithLine(double a0[3], double a1[3], double tol,
double& t, double x[3], double pcoords[3],
int &subId, vtkIdType &cellId,
Expand Down
11 changes: 5 additions & 6 deletions Common/DataModel/vtkCellLocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ class VTKCOMMONDATAMODEL_EXPORT vtkCellLocator : public vtkAbstractCellLocator

/**
* Return intersection point (if any) AND the cell which was intersected by
* the finite line. The cell is returned as a cell id and as a generic cell.
* For other IntersectWithLine signatures, see vtkAbstractCellLocator
* the finite line. The cell is returned as a cell id and as a generic
* cell. For other IntersectWithLine signatures, see
* vtkAbstractCellLocator. Note this is currently not thread-safe.
*/
int IntersectWithLine(double a0[3], double a1[3], double tol,
double& t, double x[3], double pcoords[3],
Expand Down Expand Up @@ -109,8 +110,8 @@ class VTKCOMMONDATAMODEL_EXPORT vtkCellLocator : public vtkAbstractCellLocator
* for loop. If a closest point is found, "cell" contains the points and
* ptIds for the cell "cellId" upon exit. If a closest point is found,
* inside returns the return value of the EvaluatePosition call to the
* closest cell; inside(=1) or outside(=0).
* For other FindClosestPointWithinRadius signatures, see vtkAbstractCellLocator
* closest cell; inside(=1) or outside(=0). For other
* FindClosestPointWithinRadius signatures, see vtkAbstractCellLocator.
*/
vtkIdType FindClosestPointWithinRadius(
double x[3], double radius, double closestPoint[3],
Expand Down Expand Up @@ -220,5 +221,3 @@ class VTKCOMMONDATAMODEL_EXPORT vtkCellLocator : public vtkAbstractCellLocator
};

#endif


Loading

0 comments on commit a007b93

Please sign in to comment.