[vtkusers] How to generate triangles from 3d points

Ha Pham hapham at cs.utah.edu
Wed Sep 21 10:30:50 EDT 2005


I am doing my homework and I generate triangles like this, (assignment1.vtk 
consists of 3D points). Hope can help. Note: I still face problem that 
cannot display the surface but just scattered 3D points, so careful when you 
use my code. BTW, anyone know my problem please let me know. Thank you

vtkPolyDataReader reader
  reader SetFileName "../vtkData/assignment1.vtk"
  reader Update
vtkPolyData data
   data SetPoints [[reader GetOutput] GetPoints]

vtkDelaunay3D del
    del SetInput data
    del BoundingTriangulationOn
    del SetTolerance 0.01
    del SetAlpha 0.2
    del BoundingTriangulationOff

vtkShrinkFilter shrink
    shrink SetInput [del GetOutput]
    shrink SetShrinkFactor 0.9

 vtkElevationFilter elevation
    elevation SetInput [shrink GetOutput]
    elevation SetLowPoint 0 0 0
    elevation SetHighPoint 0 0 1
   eval elevation SetScalarRange 0 1
    elevation ReleaseDataFlagOn

vtkWarpScalar warp
  warp SetInput [elevation GetOutput]
  warp SetScaleFactor -0.1

...


----- Original Message ----- 
From: "de Boer Ingo" <I.deBoer at polytec.de>
To: "David Huang" <davidhuang425 at gmail.com>; <vtkusers at vtk.org>
Sent: Wednesday, September 21, 2005 1:05 AM
Subject: RE: [vtkusers] How to generate triangles from 3d points


Hi,

I am not sure about ITK but VTK has Delaunay classes to
generate triangles from a set of points.

greets
  Ingo


---
Dr.-Ing. Ingo H. de Boer

Polytec GmbH
Polytec-Platz 1-7, 76337 Waldbronn, Germany
phone: ++49 7243 604 106
fax  : ++49 7243 604 255

-----Original Message-----
Subject: [vtkusers] How to generate triangles from 3d points


Hi, All

I am trying to generate a triangle set T:(t1,t2,t3...) from a data set of 3D 
points P:(p1,p2,p3...).
I want to generate an index table like follows:
t1={p1,p2,p3}
t2={p2,p4,p7}
t3={p5,p9,p1} ...
The only thing i know is the coordinates of 3D points.
Is there any class or function of ITK can help me to find the relationship 
of 3 close points and generate a triangle?

Thank you very much.

David



_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: 
http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list