[vtkusers] vtkModifiedBSPTree slicing

Biddiscombe, John A. biddisco at cscs.ch
Thu Mar 22 06:01:00 EDT 2012


I'm not familiar with the exact implementation they refer to, but the answer is no, you can't do this directly using the vtk classes.

There are contributions floating around out there which do some CSG, but it sounds like you have played with them and are having trouble. Perhaps someone else reading this can chip in with suggestions.

JB

From: edd cmaugo [mailto:edcpwk at gmail.com]
Sent: 22 March 2012 09:48
To: Biddiscombe, John A.
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] vtkModifiedBSPTree slicing

I want to do this because when you slice a vtkpolydata representing a volume, depending on the quality of the model, the resulting slices are not always closed.
I rely on heuristics to close them but I just saw this page that say that, by using a BSP tree, the result of the slicing operation is guaranteed to be closed.

http://www.me.mtu.edu/~rmdsouza/CSG_BSP.html

I just want to know if it's possible to make it with vtk classes.

--
Eddy
2012/3/22 Biddiscombe, John A. <biddisco at cscs.ch<mailto:biddisco at cscs.ch>>
erratum. I should have written "to add an intersect with plane" - not line.

seeing the question again, you ask about vtkCutter, so in theory you might want any ImplicitFunction. The same argument applies, but the implementation become slightly more involved as you would have to test each box against the function and not against a simple plane.

JB

From: vtkusers-bounces at vtk.org<mailto:vtkusers-bounces at vtk.org> [mailto:vtkusers-bounces at vtk.org<mailto:vtkusers-bounces at vtk.org>] On Behalf Of Biddiscombe, John A.
Sent: 21 March 2012 17:12
To: edd cmaugo; vtkusers at vtk.org<mailto:vtkusers at vtk.org>
Subject: Re: [vtkusers] vtkModifiedBSPTree slicing

>Is it possible to slice a vtkModifiedBSPTree with a vtkCutter ?
Not without code changes. Why would you do this? You can slice a vtkDataSet with a cutter and that will give you much the same result.

Do you have data already in the BSP tree? and you want to cut it faster?

If the answer is yes to both, then look at the BSP tree intersect with line code. I think in my local repo I may have an intersect with Box function too. To add an intersect with line, you need only walk the tree using the stack in the same way as the existing code, test each bounding box against the slice plane and reject any on the wrong side. open those that overlap and then keep going until you get to cells. Then you can call vtkCell intersect/slice or whatever.
It would be quite simple to implement if you examine the existing code.

JB

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120322/5e61ca8f/attachment.htm>


More information about the vtkusers mailing list