getting point information from vtkCutter

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

getting point information from vtkCutter

Clare Fitzpatrick
Hi All,
 
From what i understand, an instance of vtkCutter gives a PolyData output, which is basically a list of points or lines. So where is this list stored and is it possible to access the coordinates of these points?
I am intersecting two cutting planes and i want to extract the points of intersection. So far i have been able to use vtkGlyph3D to apply spheres (or whatever) onto the intersecting points but I dont know how to get their coordinates (without using vtkPicker - i want to do this automatically!).
 
Thanks,
Clare
 

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: getting point information from vtkCutter

Randall Hand
Refer to the documentation for vtkPointSet, the parent class for vtkPolyData. http://www.vtk.org/doc/release/5.0/html/a01876.html

Then do something like:

double *point;
vtkPointSet *dataset = cutterFilter->GetOutput();
for(i=0; i<dataset->GetNumberOfPoints(); i++) {
    point = dataset->GetPoint(i);
    printf("Point %i: %lf, %lf, %lf\n", i, point[0], point[1], point[2]);
}

On 2/6/06, Clare Fitzpatrick <[hidden email]> wrote:
Hi All,
 
From what i understand, an instance of vtkCutter gives a PolyData output, which is basically a list of points or lines. So where is this list stored and is it possible to access the coordinates of these points?
I am intersecting two cutting planes and i want to extract the points of intersection. So far i have been able to use vtkGlyph3D to apply spheres (or whatever) onto the intersecting points but I dont know how to get their coordinates (without using vtkPicker - i want to do this automatically!).
 
Thanks,
Clare
 

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank"> http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers





--
Randall Hand
Visualization Scientist,
ERDC-MSRC Vicksburg, MS
Homepage: http://www.yeraze.com
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: getting point information from vtkCutter

Clare Fitzpatrick
Thanks Randall,
 
Have that working now with:
 
set numPoints [[cutterFilter GetOutput] GetNumberOfPoints]
 
for {set i 0} {$i < $numPoints} {incr i} {
        set point [[cutterFilter GetOutput] GetPoint $i]
        puts "Point $i: [lindex $point 0] [lindex $point1] [lindex $point 2]"
}
 
Clare
----- Original Message -----
Sent: Monday, February 06, 2006 3:03 PM
Subject: Re: [vtkusers] getting point information from vtkCutter

Refer to the documentation for vtkPointSet, the parent class for vtkPolyData. http://www.vtk.org/doc/release/5.0/html/a01876.html

Then do something like:

double *point;
vtkPointSet *dataset = cutterFilter->GetOutput();
for(i=0; i<dataset->GetNumberOfPoints(); i++) {
    point = dataset->GetPoint(i);
    printf("Point %i: %lf, %lf, %lf\n", i, point[0], point[1], point[2]);
}

On 2/6/06, Clare Fitzpatrick <[hidden email]> wrote:
Hi All,
 
From what i understand, an instance of vtkCutter gives a PolyData output, which is basically a list of points or lines. So where is this list stored and is it possible to access the coordinates of these points?
I am intersecting two cutting planes and i want to extract the points of intersection. So far i have been able to use vtkGlyph3D to apply spheres (or whatever) onto the intersecting points but I dont know how to get their coordinates (without using vtkPicker - i want to do this automatically!).
 
Thanks,
Clare
 

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target=_blank>http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
<A onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target=_blank>http://www.vtk.org/mailman/listinfo/vtkusers





--
Randall Hand
Visualization Scientist,
ERDC-MSRC Vicksburg, MS
Homepage: http://www.yeraze.com

_______________________________________________
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