[vtkusers] linear equation

tony hakki tony2007vtk at yahoo.com
Mon Mar 5 05:02:39 EST 2007


I have a point and a normal direction I would like to set up a linear equation which describes my line in normal direction. and then So I would like to calculate through which voxels (in 3D object)  line goes. Is it possible to implement this by using vtk? 

here What I have done so far
vtkSTLReader *read = vtkSTLReader::New();
read->SetFileName("sample.stl");
read->Update();
vtkPolyData *Source=read->GetOutput();
int npts;
vtkPoints* stlpoints = Source->GetPoints();
npts = Source->GetNumberOfPoints();
vtkFloatingPointType stlpoint[3];
vtkFloatArray *PointArray = vtkFloatArray::New(); 
PointArray->SetNumberOfComponents(3);
PointArray->SetNumberOfTuples(npts);
for(int i =0; i < npts; ++i) 
{
stlpoints->GetPoint(i, stlpoint);
PointArray->SetTuple(i, stlpoint);
}

vtkPolyDataMapper *readmap=vtkPolyDataMapper::New();
readmap->SetInput(Source);
vtkPolyDataNormals *normals=vtkPolyDataNormals::New();
normals->SetInput(Source);
normals->SetFeatureAngle(60.0f);
normals->Update();


In attachment what i would like to get can be easily seen (linear equation)


 
____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070305/ccd7884d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample_picture.JPG
Type: image/pjpeg
Size: 11064 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070305/ccd7884d/attachment.bin>


More information about the vtkusers mailing list