[vtkusers] making new cell types?

Mathieu Malaterre mathieu.malaterre at kitware.com
Tue Sep 21 09:54:05 EDT 2004


Sonam,

$ cd VTK/Common
$ grep CONVEX vtkCellType.h 

#define VTK_CONVEX_POINT_SET 41

	Anyway if you don't know how to write this cell in a file, then do the 
contrary. Create an object vtkConvexPointSet, then save it in a file... 
that's reverse engineering on open source :)

HTH
Mathieu

s comp wrote:
> Thanks for the advice Mathieu,
>  
> For now I wil just try using vtkConvexPointSet what is the cell type 
> number of this? (if there is one - can it be used like other cell types 
> when writing data to vtk file format?)
>  
> Sonam
> 
> */Mathieu Malaterre <mathieu.malaterre at kitware.com>/* wrote:
> 
>     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
> 
> 
> 
> ------------------------------------------------------------------------
> Find local movie times and trailers on *Yahoo! Movies.* 
> <http://au.rd.yahoo.com/mail/tagline/*http://au.movies.yahoo.com>






More information about the vtkusers mailing list