[vtkusers] making new cell types?

Mathieu Malaterre mathieu.malaterre at kitware.com
Mon Sep 20 09:59:12 EDT 2004


Sonam,

	See my interlaced comments.

s comp wrote:
> Is it possible to use cell types in vtk that are not mentioned in the 
> file formats documentation? (without modifying source). 

Yes, and no :)
You can use vtkConvexPointSet:
http://www.vtk.org/doc/nightly/html/classvtkConvexPointSet.html

But I don't consider this as long term solution.

> I would like to 
> use a cell type that is a cube with one corner cut off, so that the new 
> shape has 7 faces: 3 squares, and 4 triangles, and 7 vertices. Also as 
> mentioned in a previous post I would also like to use pyramids with more 
> than four sided base.

Then in that case I really suggest you copy/paste other vtkCell subclass 
and adapt to your changes. I believe that vtkConvexPointSet is really 
slow on cut/contour/clip operation. So I'd suggest you write your own class.


> Any advice on how I could do this would be greatly appreciated.

Adding a new subelement to vtkCell3d is not that hard. Have a look in 
the CVS for vtkHexagonalPrism. They used to be much more lighter and 
should give you some clue on how to start. BTW I believe that your 
pyramid with 5 points on the base is a degenerate case of a pentagonalprism.

HTH
Mathieu





More information about the vtkusers mailing list