[vtkusers] Re: vtkHull Bug?
Kitware Support
support at kitware.com
Mon Sep 17 09:05:36 EDT 2001
Hello Audrius,
Do they look incorrect visually? I am wondering if there is a stray point
or two in the output of the vtkHull that is causing the larger bounds. If
you pass an outline filter around both what do you see?
Lisa
At 11:00 PM 9/15/2001, Audrius Stundzia wrote:
>Hi,
>
>I'm trying to use vtkHull to enclose an isosurface in its bounding box.
>I'd expect the bounds of the vtkHull object to correspond to those
>of the isosurface bounding box. In the following, they don't agree
>
> isosurfaceBounds[0] -69.7140
> hullBounds[0] -88.5630
>
> isosurfaceBounds[1] 73.5724
> hullBounds[1] 84.0858
>
> isosurfaceBounds[2] -68.9686
> hullBounds[2] -68.9686
>
> isosurfaceBounds[3] 94.0632
> hullBounds[3] 94.0632
>
> isosurfaceBounds[4] -58.7823
> hullBounds[4] -65.2978
>
> isosurfaceBounds[5] 64.5568
> hullBounds[5] 64.5568
>
>Is this a bug. Or am I not using vtkHull correctly?
>
>Any insight would be most appreciated.
>
>Thanks.
>
>Regards,
>
>Audrius
>
>================================
>
>The relevant code fragment follows:
>
> isosurfacePolyData->Update();
> isosurfacePolyData->ComputeBounds();
> isosurfacePolyData->GetBounds( isosurfaceBounds );
>
>
> vtkHull *isosurfaceBoundsBox = vtkHull::New();
> isosurfaceBoundsBox->SetInput( isosurfacePolyData);
> float boundingPlaneNormal[_3D];
>
> <file://-----Left>///---Left plane
>
> boundingPlaneNormal[0] = -1.0;
> boundingPlaneNormal[1] = 0.0;
> boundingPlaneNormal[2] = 0.0;
>
> int testReturn = isosurfaceBoundsBox->AddPlane( boundingPlaneNormal);
>
> <file://-----Right>///-----Right plane
>
> boundingPlaneNormal[0] = 1.0;
> boundingPlaneNormal[1] = 0.0;
> boundingPlaneNormal[2] = 0.0;
> testReturn = isosurfaceBoundsBox->AddPlane( boundingPlaneNormal);
>
><file://-----Anterior>///-----Anterior plane
>
> boundingPlaneNormal[0] = 0.0;
> boundingPlaneNormal[1] = 1.0;
> boundingPlaneNormal[2] = 0.0;
>
> testReturn = isosurfaceBoundsBox->AddPlane( boundingPlaneNormal);
>
><file://-----Posterior>///-----Posterior plane
>
> boundingPlaneNormal[0] = 0.0;
> boundingPlaneNormal[1] = -1.0;
> boundingPlaneNormal[2] = 0.0;
>
> testReturn = isosurfaceBoundsBox->AddPlane( boundingPlaneNormal);
>
><file://-----Inferior>///-----Inferior plane
>
> boundingPlaneNormal[0] = 0.0;
> boundingPlaneNormal[1] = 0.0;
> boundingPlaneNormal[2] = -1.0;
>
> testReturn = isosurfaceBoundsBox->AddPlane( boundingPlaneNormal);
>
> <file://-----Superior>///-----Superior plane
>
> boundingPlaneNormal[0] = 0.0;
> boundingPlaneNormal[1] = 0.0;
> boundingPlaneNormal[2] = 1.0;
>
> testReturn = isosurfaceBoundsBox->AddPlane( boundingPlane);
>
> isosurfaceBoundsBox->Update();
> int nPlanes = isosurfaceBoundsBox->GetNumberOfPlanes();
>
> float hullBounds[_3DBounds];
> isosurfaceBoundsBox->GetOutput()->ComputeBounds();
> isosurfaceBoundsBox->GetOutput()->GetBounds( hullBounds);
>
>
>----------
>Get your FREE download of MSN Explorer at http://explorer.msn.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20010917/2ad15254/attachment.htm>
More information about the vtkusers
mailing list