[vtkusers] vtkCutter with quad hexes in v4.2

James Robinson j.robinson at kepler-systems.com
Tue Aug 3 17:46:13 EDT 2004


Dear All,

 

A while ago I sent some queries in regard trying to use vtkCutter with v4.2
and quad hexahedra type elements. I have two different programmes in which I
have tried to get this to work. In both cases I get a rendering of the outer
surface of my vtkUnstructuredGrid but the cut surface itself is invisible.
The code for creating the cut  surface is:

 

void CSampleDoc::CreateCrossSectionActor()

{

            vtkFloatingPointType bounds[6] ;

            vtkFloatingPointType center[3] ;

            GetView()->Renderer->ComputeVisiblePropBounds(bounds) ; 

            center[0] = (bounds[0] + bounds[1])/2.0;

            center[1] = (bounds[2] + bounds[3])/2.0;

            center[2] = (bounds[4] + bounds[5])/2.0;

// Middle of the object

    pPlane->SetOrigin(center[0],center[1],center[2]) ; 

    pPlane->SetNormal(0.0,1.0,0.0) ;

 

// The actual plane surface

            pCrossSection->SetCutFunction(pPlane) ;

    pCrossSection->SetInput(pUnstructuredGrid) ;

 

// What is left after the cut is made

    pXSectionClipper->SetInput(pGeometry->GetOutput()) ;

            pXSectionClipper->SetClipFunction(pPlane) ;

 

    pCutMeshData->AddInput(pXSectionClipper->GetOutput()) ;

    pCutMeshData->AddInput(pCrossSection->GetOutput()) ;

 

 

            pXSectionMapper->SetInput(pCutMeshData->GetOutput()) ;

 

 

    pCrossSectionActor->SetMapper(pXSectionMapper);

 

    pCutWireFrame->SetInput(pCutMeshData->GetOutput()) ;

    pCutWireFrame->ManifoldEdgesOn() ;

            pCutWireFrameMapper->SetInput(pCutWireFrame->GetOutput()) ;

            pCutWireFrameMapper->ScalarVisibilityOff() ;

 

    pCutEdgeActor->SetMapper(pCutWireFrameMapper);

    (pCutEdgeActor->GetProperty())->SetColor(0.0,0.0,0.0) ;

 

}

 

Where:

public:

  vtkPlane          *pPlane ;

protected:

  vtkGeometryFilter         *pGeometry ;

  vtkCutter         *pCrossSection ;

  vtkClipPolyData   *pXSectionClipper ;

  vtkAppendPolyData *pCutMeshData ;

  vtkPolyDataMapper *pXSectionMapper;

  vtkActor          *pCrossSectionActor ;

  vtkFeatureEdges   *pCutWireFrame ;

  vtkPolyDataMapper *pCutWireFrameMapper;

  vtkActor          *pCutEdgeActor;

 

Note also that when I try to turn on the scalar visibility of the
pXSectionMapper, it doesn't work (just shows up grey).

 

NB: When I use the same program on a linear hexahedra type mesh
(unstructured grid) it works.

 

Has anyone else tried to do something like this and had better results? Have
any bugs that might cause such behaviour been mended?

 

Regards,

 

Jim

 

James C Robinson, PhD, Chartered Engineer,

*     42 Rivergrove,

         Glanmire,

         Co. Cork,

         Eire

'     +353 21 4822028

         +353 87 2393010

6      +353 21 4822028

*    j.robinson at kepler-systems.com 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040803/9fc657f4/attachment.htm>


More information about the vtkusers mailing list