Samuel, Thanks for taking the efforts to dive into this. In fact, it is a good reminder to me to try a single tetraeder first. My primary problem seems to be that I cannot get volume rendering to work.
Kind Regards, Bertwim On 10/13/2014 07:17 PM, Samuel Key wrote: > Cory, Bertwin, et al.; > > The exact volume of an arbitrarily oriented, arbitrary 8-vertex > hexahedron can be computed with a very elementary construct. > > First, place an average-coordinate point at the center of the > hexahedron; this point will be a common vertex point for a set of > tetrahedrons whose construction follows. > > Second, visiting the six faces of the hexahedron, place an > average-coordinate point at the center of the quadrilateral polygonal > face. > For each of the four triangles, construct the four tetrahedrons using > the center point above of the parent hexahedron. > > The only limitation is that the arbitrary 8-vertex hexhedron must be > star-convex with respect to the hexaheron's average-coordinate center > point. This construct works for triangular prisms and pyramids with a > quadrilateral base. > > Once one has the coordinates of four vertex nodes defining a > tetrahedron, the volume calculation of a tetrahedron is straight > forward. Clearly, the total volume of the hexahedron is the sum of its > 24 tetrahedral decomposition volumes. > > If an n-vertex polyhedron finite element's mean quadrature gradient > operator is constructed the same way as above, then the above > construct works for the n-vertex polyhedron. > > If an iso-surface transects the edges of an 8-node hexahedron and the > resulting two sibling n-vertex polyhedrons are used as individual > finite elements (which has been done), then the the above construct > also provides exact volume fractions with respect to the two sibling > n-vertex polyhedrons. The polygonal intersection surface need not be > planar surface. > > If multiple, non-intersecting iso-surfaces transect a hexahedron, then > the respective volume fractions within the hexahedron can exactly be > calculated inductively. > > Cory, If you want to follow up off-line, I can provide a more lengthy > write up with references plus example coding. Because of computational > costs, I don't recommend this algorithm except in a user-invoked filter. > > Samuel W Key > FMA Development, LLC > 1005 39th Ave NE > Great Falls, Montana 59404 > > > > > On 10/13/2014 9:36 AM, Cory Quammen wrote: >> Bertwim, >> >> I'm not sure that the volume renderer can handle VTK_HEXAHEDRON >> elements. Try the "Tetrahedralize" filter on your source and see if >> the Volume representation works. >> >> Thanks, >> Cory >> >> On Mon, Oct 13, 2014 at 10:19 AM, B.W.H. van Beest <[email protected]> >> wrote: >>> Hi, >>> >>> I'm struggling to get a proper 3D view of my model system (yes, >>> embarrassing!) >>> but must admit my defeat. >>> After stripping almost everything, keeping the minimum to exhibit the >>> issue, >>> I'm left with the following: >>> >>> I have created a simple box source. To get a 3D representation, I >>> sub-classed >>> the code for this Source from vtkUnstructuredGridAlgorithm. >>> >>> In the RequestData method, I define the 8 point of the unit cube. I >>> added the points to the >>> underlying unstructed grid, and I specified the cell topology. >>> >>> This all seems to work: when instantiating this box Source, I *do* >>> get the >>> expected cube in the representations (Surface, wireframe, Points). >>> >>> However, when I select the "Volume" representation, *the image >>> disappears* >>> What am I doing wrong? >>> >>> As the code is not too long and very simple, I take the freedom to >>> paste >>> it below. >>> >>> Kind regards. >>> Bertwim >>> >>> ========================================= >>> >>> int sphBoxSourceC::RequestData( vtkInformation *vtkNotUsed(request), >>> vtkInformationVector >>> **vtkNotUsed(inputVector), >>> vtkInformationVector *outputVector) >>> { >>> // Get the info object >>> vtkInformation *outInfo = outputVector->GetInformationObject(0); >>> vtkUnstructuredGrid *umesh = vtkUnstructuredGrid::SafeDownCast( >>> outInfo->Get( vtkDataObject::DATA_OBJECT() ) ); >>> >>> // Pre-allocate some memory >>> umesh->Allocate( 1024 ); >>> >>> // Specify points. >>> double r0[] = { 0.0, 0.0, 0.0 }; >>> double r1[] = { 1.0, 0.0, 0.0 }; >>> double r2[] = { 0.0, 1.0, 0.0 }; >>> double r3[] = { 1.0, 1.0, 0.0 }; >>> double r4[] = { 0.0, 0.0, 1.0 }; >>> double r5[] = { 1.0, 0.0, 1.0 }; >>> double r6[] = { 0.0, 1.0, 1.0 }; >>> double r7[] = { 1.0, 1.0, 1.0 }; >>> >>> // Collect the points in a vtk data structures. >>> { >>> vtkSmartPointer<vtkPoints> points = >>> vtkSmartPointer<vtkPoints>::New(); >>> points->SetDataType( VTK_DOUBLE ); >>> >>> points->InsertNextPoint( r0 ); >>> points->InsertNextPoint( r1 ); >>> points->InsertNextPoint( r2 ); >>> points->InsertNextPoint( r3 ); >>> points->InsertNextPoint( r4 ); >>> points->InsertNextPoint( r5 ); >>> points->InsertNextPoint( r6 ); >>> points->InsertNextPoint( r7 ); >>> >>> // Transfer points to umesh. >>> umesh->SetPoints( points ); >>> } >>> >>> // Cell Topology >>> vtkIdType vtx[8] = { 0, 1, 3, 2, 4, 5, 7, 6 }; >>> umesh->InsertNextCell( VTK_HEXAHEDRON, 8, vtx ); >>> >>> return 1; >>> } >>> >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the ParaView Wiki at: >>> http://paraview.org/Wiki/ParaView >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/paraview >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the ParaView Wiki at: >> http://paraview.org/Wiki/ParaView >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/paraview >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the ParaView Wiki at: > http://paraview.org/Wiki/ParaView > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/paraview > > _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
