[vtkusers] render point set as point cloud

Goodwin Lawlor goodwin.lawlor at ucd.ie
Wed Sep 4 17:16:16 EDT 2002


Hi John,

You are right- you need a cell array (i.e. the topology) and a point list
(i.e. the geometry) to make a complete dataset that you can render.

If you have a vtkPolyData object (called pointcloud below) with the the
point list set, here's how you complete the dataset (in Tcl)...


set numPts [pointcloud GetNumberOfPoints]
vtkCellArray vertices

# here a vertex cell is inserted in the CellArray for
# every point in the point list
for {set i 0} {$i < $numPts} {incr i} {
    vertices InsertNextCell 1
    vertices InsertCellPoint $i
}

pointcloud SetVerts vertices

vtkPolyDataMapper mapper
    mapper SetInput pointcloud

vtkActor actor
    actor SetMapper mapper

etc....

HTH

Goodwin
University College Dublin

ps If you've a different situation send me a mail

----- Original Message -----
From: "Randy Heiland" <heiland at ncsa.uiuc.edu>
To: <anast.jm at pg.com>; <vtkusers at public.kitware.com>
Sent: Wednesday, September 04, 2002 9:18 PM
Subject: Re: [vtkusers] render point set as point cloud


> Here's what I did:
>
>  http://www.ncsa.uiuc.edu/~heiland/vtk/scatter/sphere/sphere2.py
>
> --Randy
>
>
> On Sep 4,  2:37pm, anast.jm at pg.com wrote:
> > Subject: [vtkusers] render point set as point cloud
> >
> > I have a vtkPolyData set of just unstructured points (no connectivity,
no
> > attributes) that I would like to render as a point cloud. I've tried
> > vtkPolyDataMapper and vtkDataSet Mapper but neither would produce the
point
> > cloud when rendered. The man page for DataSetMapper states it needs cell
data
> > which I don't have so I'm assuming PolyDataMapper  wants the same?? Is
there
> a
> > filter I could run my point set through to get the render to show the
point
> > cloud? I 'm  tempted to try glyphing each point but thought there must
be a
> > simpler way. Any suggestions appreciated....john
> >
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list