[vtkusers] intersection of two boxes

Luca Antiga luca.antiga at gmail.com
Fri Aug 1 10:55:13 EDT 2008


Hi Dean,
  I guess you can use vtkClipPolyData, but you have to make
sure your cube has enough vertices so that the zero crossing of the
implicit function is evaluated with enough resolution.
You could create the box with vtkCubeSource, pass it through
vtkTriangleFilter and then through vtkLinearSubdivisionFilter with
a few levels of subdivision (say, SetNumberOfSubdivisions(5)).
At that point try clipping. For sharper corners, you can increase
the number of subdivisions.
Hope this helps

Luca


On Aug 1, 2008, at 4:13 AM, Dean Inglis wrote:

> Hi all.
>
>
>
> I have been trying for several days now to visualize
>
> the intersection of two boxes: one is axis aligned (x,y,z), the
>
> other is oriented obliquely to the other such that
>
> some vertices of the second box can be outside
>
> of the volume of the first box.  I have tried vtkCutter,
>
> vtkClipDataSet, vtkClipPolyData, vtkBoxClipDataSet,
>
> vtkClipVolume all with vtkImplicitFunctions such as vtkPlanes and
>
> vtkBox but no luck.  I have represented the boxes as
>
> vtkImageData or vtkRectilinearGrid or even vtkPolyData
>
> generated by vtkCubeSource.
>
>
>
>  The best I could do was create two vtkBox objects and pass them
>
> to  a vtkImplicitBoolean and then sample its output
>
> with vtkSampleFunction and then use vtkContourFilter
>
> to pull out the isosurface of the intersection between
>
> the two boxes.  This last pipeline does not produce
>
> the “crisp” edges that I am looking for (see attached jpg).
>
> Im looking for the kind of quality you can achieve using
>
> vtkCutter with a vtkPlane to cut through a vtkImageData:
>
> as is done internally with vtkImplicitPlaneWidget (I guess I’m
>
> looking for a vtkImplicitVolumeWidget).
>
>
>
> Has anyone tackled this scenario before or does anyone
>
> have any recommendations?
>
>
>
> Dean
>
>
>
> <Image1.jpg>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/ 
> Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list