[vtkusers] Intersection?

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Mon Sep 2 17:53:16 EDT 2002


Sriram,
  You could define your cube with vtkPlanes (a descendant of
vtkImplicitFunction) and pass this to clipper->SetClipFunction. Then pass
your line to clipper->SetInput. Clipping will remove the part of the line
inside the cube. If you want the intersections(s) you probably really want
to use vtkCutter in the same way ( cutter->SetClipFunction( cube ),
cutter->SetInput( line ) ). Given a line as input this will output points
(usually).
Note that fhe abstract class vtkCell declares the method IntersectWithLine,
which might be a more direct (but low-level) way to get what you want.

  regards, Dave




|--------+--------------------------------->
|        |          "Subramanian, S."      |
|        |          <S.Subramanian at tue.nl> |
|        |          Sent by:               |
|        |          vtkusers-admin at public.k|
|        |          itware.com             |
|        |                                 |
|        |                                 |
|        |          31/08/2002 09:23       |
|        |                                 |
|--------+--------------------------------->
  >------------------------------------------------------------------------------------------------------------|
  |                                                                                                            |
  |      To:     "'vtkusers at public.kitware.com'" <vtkusers at public.kitware.com>                                 |
  |      cc:                                                                                                   |
  |      Subject:     [vtkusers] Intersection?                                                                 |
  >------------------------------------------------------------------------------------------------------------|




Hi,
 I am  new to vtk and have the following question.
How do I find the point of intersection of a cube with a line using vtk?
Can I use vtkclippolydata?
I tried the following but it gives an error that vtkline is not part of
ImplicitFunction.

           vtkLine *line = vtkLine::New();
                     line->GetPointIds()->SetId(0,0);
                     line->GetPointIds()->SetId(1,1);
                     line->GetPoints()->SetPoint(0,point1);
                     line->GetPoints()->SetPoint(1,point2);

           vtkClipPolyData *clipper = vtkClipPolyData::New();
                     clipper->SetInput(cube->GetOutput());
                     clipper->SetClipFunction(line);
                     clipper->GenerateClippedOutputOn();
                     clipper->SetValue(0.5);
I tried introducing
vtkImplicitDataSet *dataset;
but line is not compatible with that too.
I am missing something silly here,
Can you help me?
thanks in advance,
Sriram
_______________________________________________
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