[vtkusers] QuadraticHexahedra
James C. Robinson
j.robinson at kepler-systems.com
Wed Apr 28 06:04:58 EDT 2004
Dear All,
Before I begin - I don't have simple example code to demonstrate the
problem, but I still cannot implement the vtkQuadraticHexahedra properly. (I
am using v4.2.). I have my code set up for multiple builds, so I can choose
which version to compile with, as well as which element (cell)
representation to use in VTK. When I use the linear hexahedra, both the
vtkCutter probe and the vtkStreamTracer are behaving well. However, when I
change to vtkQuadraticHexahedra, neither work - that is, the cut surface is
not there and the streamtube (which is based on the vtkStreamTracer) is not
there either.
Here are some simple snippets:
vtkUnstructuredGridReader *pMeshReader ;
vtkUnstructuredGrid *pUnstructuredGrid ;
vtkGeometryFilter *pGeometry ;
vtkPlane *pPlane ;
CPlane *pCutPlane ;
protected:
vtkCutter *pCrossSection ;
vtkClipPolyData *pXSectionClipper ;
vtkAppendPolyData *pCutMeshData ;
vtkPolyDataMapper *pXSectionPressureMapper;
vtkActor *pCrossSectionPressureActor ;
vtkPolyDataMapper *pXSectionMaterialMapper;
vtkActor *pCrossSectionMaterialActor ;
vtkFeatureEdges *pCutWireFrame ;
vtkPolyDataMapper *pCutWireFrameMapper;
vtkActor *pCutEdgeActor;
// A plane and cross section
pMeshReader = vtkUnstructuredGridReader::New();
pGeometry = vtkGeometryFilter::New() ;
// The file is linked to the vtkUnstructuredGridReader in here
pUnstructuredGrid = pMeshReader->GetOutput() ;
pGeometry->SetInput(pUnstructuredGrid) ;
pPlane = vtkPlane::New() ;
pCrossSection = vtkCutter::New() ;
pXSectionClipper = vtkClipPolyData::New() ;
pCutMeshData = vtkAppendPolyData::New() ;
pXSectionPressureMapper = vtkPolyDataMapper::New() ;
pXSectionMaterialMapper = vtkPolyDataMapper::New() ;
pCrossSectionPressureActor = vtkActor::New();
pCrossSectionMaterialActor = vtkActor::New();
pCrossSectionPressureActor->VisibilityOff();
pCrossSectionMaterialActor->VisibilityOff();
pCutWireFrame = vtkFeatureEdges::New() ;
pCutWireFrameMapper = vtkPolyDataMapper::New() ;
pCutEdgeActor = vtkActor::New();
pCutEdgeActor->VisibilityOff();
pCutPlane = new CPlane() ; // My own class
pMyFlowPlane = new CPlane() ;
// The plane used to cut the mesh
pPlane->SetOrigin(0.0,0.0,0.0) ; // Mid point of the wellbore
pPlane->SetNormal(0.0,1.0,0.0) ;
// The actual plane surface
pCrossSection->SetInput(pMeshReader->GetOutput()) ;
pCrossSection->SetCutFunction(pPlane) ;
// What is left after the cut is made
pXSectionClipper->SetInput(pGeometry->GetOutput()) ;
pXSectionClipper->SetClipFunction(pPlane) ;
pCutMeshData->AddInput(pXSectionClipper->GetOutput()) ;
pCutMeshData->AddInput(pCrossSection->GetOutput()) ;
if (CreateLookUpTable) pXSectionPressureMapper->SetLookupTable(pLut) ;
pXSectionPressureMapper->SetInput(pCutMeshData->GetOutput()) ;
if (CreateLookUpTable) pXSectionMaterialMapper->SetLookupTable(pMatLut)
;
pXSectionMaterialMapper->SetInput(pCutMeshData->GetOutput()) ;
pXSectionMaterialMapper->SetScalarModeToUseCellData() ;
pCrossSectionPressureActor->SetMapper(pXSectionPressureMapper);
pCrossSectionMaterialActor->SetMapper(pXSectionMaterialMapper);
pCutWireFrame->SetInput(pCutMeshData->GetOutput()) ;
pCutWireFrame->ManifoldEdgesOn() ;
pCutWireFrameMapper->SetInput(pCutWireFrame->GetOutput()) ;
pCutWireFrameMapper->ScalarVisibilityOff() ;
pCutEdgeActor->SetMapper(pCutWireFrameMapper);
(pCutEdgeActor->GetProperty())->SetColor(0.0,0.0,0.0) ;
I give up... trying to extract the pertinent bits is a little arduous.
Instead, think of it this way... Have any of you successfully used vtkCutter
to slice through a quadhex mesh? If yes, have you examples of code.
Similarly on examples of vtkStreamTracer with quad hexes.
Many thanks,
Jim
______________________
James C. Robinson, PhD,
Chartered Engineer,
Kepler Simulation Systems Ltd.,
42 Rivergrove,
Glanmire, Co. Cork,
Eire
Tel: +353-21-4822028
Tel: +353-87-2393010
Fax: +353-21-4822028
E-mail: j.robinson at kepler-systems.com
______________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 6860 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040428/188682c4/attachment.bin>
More information about the vtkusers
mailing list