[vtkusers] How to compute intersection between surface polydata in vtk?

Jean-Dominique Barnichon jeando.barnichon at free.fr
Mon Apr 10 17:27:05 EDT 2006


To close this discussion, and for the record on the vtkusers list, in 
case other people are interested.
Jean-Do
(Thanks Goodwin, and the best for your thesis...)

Goodwin Lawlor a écrit :
> Hi Jean-Do,
>
>> Last two questions:
>> - the classes you developed are really great, especially as there's 
>> nothing comparable (as I know at least) in the standard vtk library. 
>> Did you ever consider to make it part of the standard vtk library (I 
>> can hardly believe people at Kitware are not interested)?
> I'd have no problem if the class was a part of the standard lib... 
> though I wouldn't like to commit to long term support of the class.
>> - what's the deal if I want to develop a commercial application using 
>> your vtkCollisionDetection class?
> I'm putting the classes up on sourceforge.net under a BSD licence- "do 
> whatever you like with the code, free of charge, but don't blame me if 
> anything goes wrong"
>
> I've got a vtk wrapper class of the RAPID CD library... it would use 
> more memory (since it has its own data structure for models) but is 
> probably quicker for large models. I've been meaning to write a quick 
> report comparing the two classes. I've got a thesis to write, so its 
> on the backburner...
>>
>> Cheers anyway, and thanks again
>
> You're welcome.
> Regards,
>
> Goodwin
>> Jean-Do
>>
>>
>> Goodwin Lawlor a écrit :
>>> Hi Jean-Do,
>>>
>>> I fixed the vtkCollisionDetectionFilter class over the weekend... 
>>> there was a check of the inputs that remained from the vtk4.x 
>>> version of the class. The updated classes are attached. Its strange 
>>> that the tcl test didn't pick up this bug...
>>>
>>> The callback is just to print out the number of collisions as text 
>>> in the render window- its not really needed.
>>>
>>> I tried interactively modifying the spheres' radius, using the right 
>>> mouse button, and it worked for me. How were you doing it?
>>>
>>> Regards,
>>>
>>> Goodwin
>>>
>>> Jean-Dominique Barnichon wrote:
>>>> Goodwin Lawlor a écrit :
>>>>>
>>>>>
>>>>> Jean-Dominique Barnichon wrote:
>>>>>> It's better now, apart that the GeneratePolydataOutputOn() does 
>>>>>> not seem to exist anymore.
>>>>> Yes - the filter always generates an output now. There's a new 
>>>>> switch GenerateScalarsOn/Off if you want to visualize the 
>>>>> collisions or not
>>>> Ok, I got that one
>>>>
>>>>>
>>>>>>
>>>>>> So in the testCollisionDetection sample translated to c++ (see 
>>>>>> code in attached file) i commented off this line.
>>>>>> The point is that I now have two error messages when running the 
>>>>>> test :
>>>>>>    Error in vtkCollisionDetectionFilter, line 150 : index 0 is 
>>>>>> out of range in set matrix
>>>>>>    Error in vtkCollisionDetectionFilter, line 150 : index 1 is 
>>>>>> out of range in set matrix
>>>>>> Maybe this is because I did not translate the callback (as i 
>>>>>> didn't know how to write them in c++).
>>>>>
>>>>> I'll have a look at this
>>>> Thanks
>>>>>>
>>>>>> Forgot to mention, when i run the test I obtain two spheres, 
>>>>>> which radii can be modified interactively, but apparently without 
>>>>>> intersection. I attached the c++ file in case you want to test it 
>>>>>> yourself.
>>>>>> I guess I'm probably doing something wrong. Any idea?
>>>>>
>>>>> I'll run it and see what's going on.
>>>> Thanks again
>>>>>> Thanks,
>>>>>> Jean-Do
>>>>> Regards,
>>>>>
>>>>> Goodwin
>>>>>>
>>>>>> Goodwin Lawlor a écrit :
>>>>>>> Hi Jean-Do,
>>>>>>>
>>>>>>> I haven't updated the site... just the classes. I'll put them up 
>>>>>>> on sourceforge soon. The CD classes are attached.
>>>>>>>
>>>>>>> hth
>>>>>>>
>>>>>>> Goodwin
>>>>>>>
>>>>>>> Jean-Dominique Barnichon wrote:
>>>>>>>> Well,
>>>>>>>> I'm using vtk5.0.
>>>>>>>> I've dowloaded again from the bioengineering website, and it 
>>>>>>>> does not seem updated yet.
>>>>>>>> So yes, I would very much like if you could send me the new 
>>>>>>>> version that is compatible with vtk5.0.
>>>>>>>> Thanks,
>>>>>>>> Jean-Do
>>>>>>>>
>>>>>>>> Goodwin Lawlor a écrit :
>>>>>>>>> Hi Jean-Do,
>>>>>>>>>
>>>>>>>>> What vtk version are you using? I've updated the source files 
>>>>>>>>> on the bioengineering website for vtk5.0
>>>>>>>>>
>>>>>>>>> The error is due to the old class code not being compatible 
>>>>>>>>> with the new pipeline (>vtk4.5 I think).
>>>>>>>>>
>>>>>>>>> I'll send the updated class files to you, if you like.
>>>>>>>>>
>>>>>>>>> hth
>>>>>>>>>
>>>>>>>>> Goodwin
>>>>>>>>>
>>>>>>>>> ps I'm updating all the code there soon... probably moving it 
>>>>>>>>> to sourceforge.
>>>>>>>>>
>>>>>>>>> Jean-Dominique Barnichon wrote:
>>>>>>>>>> Michael,
>>>>>>>>>>
>>>>>>>>>> thanks for pointing me there.
>>>>>>>>>> I gave it a try, but I'm actually stuck.
>>>>>>>>>> Config: winXp(SP2) + msvc7.0 + vtk5.0.
>>>>>>>>>> So I downloaded everything required from bioengineering web 
>>>>>>>>>> site (vtkBioeng.zip), ran cmake and eventually built 
>>>>>>>>>> vtkBioeng library as a shared library (vtkBioeng.dll). So far 
>>>>>>>>>> so good.
>>>>>>>>>> Then I translated most of the testCollisionDetection.tcl 
>>>>>>>>>> sample given from tcl to c++ (see code below)
>>>>>>>>>> When I run it, I end up with an error located at the 
>>>>>>>>>> following line:
>>>>>>>>>>    vtkCollisionDetectionFilter *collide = 
>>>>>>>>>> vtkCollisionDetectionFilter::New();
>>>>>>>>>> Trying to debug it, an access violation is reported in the 
>>>>>>>>>> constructor of vtkCollisionDetectionFilter, at line #4 :
>>>>>>>>>>    this->Inputs[0] = NULL;
>>>>>>>>>> Apparently, from what I understand, it looks like the array 
>>>>>>>>>> Inputs[] (inherited from vtkPolyDataSource) is not 
>>>>>>>>>> initialized (value is 0x00000000).
>>>>>>>>>>
>>>>>>>>>> In case you have you already tested this sample :
>>>>>>>>>> - did you experience similar problem?
>>>>>>>>>> - if no, was it in c++ or in tcl, with which vtk version 4.x 
>>>>>>>>>> or 5.x?
>>>>>>>>>>
>>>>>>>>>> Thanks for helping
>>>>>>>>>> Jean-Do
>>>>>>>>>>
>>>>>>>>>> File testCollisionDetection.cpp
>>>>>>>>>>
>>>>>>>>>> #include "vtkProperty.h"
>>>>>>>>>> #include "vtkPolyDataMapper.h"
>>>>>>>>>> #include "vtkActor.h"
>>>>>>>>>> #include "vtkRenderWindow.h"
>>>>>>>>>> #include "vtkRenderWindowInteractor.h"
>>>>>>>>>> #include "vtkRenderer.h"
>>>>>>>>>> #include "vtkCamera.h"
>>>>>>>>>> #include "vtkSphereSource.h"
>>>>>>>>>> #include "vtkMatrix4x4.h"
>>>>>>>>>> #include "vtkCollisionDetectionFilter.h"
>>>>>>>>>> #include "vtkGlyph3D.h"
>>>>>>>>>> #include "vtkInteractorStyleJoystickActor.h"
>>>>>>>>>> #include "vtkTextActor.h"
>>>>>>>>>>
>>>>>>>>>> int _tmain(int argc, _TCHAR* argv[])
>>>>>>>>>> {
>>>>>>>>>>    vtkSphereSource *sphere0 = vtkSphereSource::New();
>>>>>>>>>>    sphere0->SetPhiResolution(30);
>>>>>>>>>>    sphere0->SetThetaResolution(30);
>>>>>>>>>>    sphere0->SetCenter(-0.7, 0, 0);
>>>>>>>>>>    sphere0->Update();
>>>>>>>>>>
>>>>>>>>>>    vtkSphereSource *sphere1 = vtkSphereSource::New();
>>>>>>>>>>    sphere1->SetPhiResolution(30);
>>>>>>>>>>    sphere1->SetThetaResolution(30);
>>>>>>>>>>    sphere1->Update();
>>>>>>>>>>
>>>>>>>>>>    vtkMatrix4x4 *matrix0 = vtkMatrix4x4::New();
>>>>>>>>>>    vtkMatrix4x4 *matrix1 = vtkMatrix4x4::New();
>>>>>>>>>>
>>>>>>>>>>    vtkCollisionDetectionFilter *collide = 
>>>>>>>>>> vtkCollisionDetectionFilter::New();
>>>>>>>>>>    collide->SetInput(0, sphere0->GetOutput());
>>>>>>>>>>    collide->SetMatrix(0, matrix0);
>>>>>>>>>>    collide->SetInput(1, sphere1->GetOutput());
>>>>>>>>>>    collide->SetMatrix(1, matrix1);
>>>>>>>>>>    collide->SetBoxTolerance(0.0);
>>>>>>>>>>    collide->SetCellTolerance(0.0);
>>>>>>>>>>    collide->SetNumberOfCellsPerBucket(2);
>>>>>>>>>>    //collide->SetCollisionModeToFirstContact();
>>>>>>>>>>    collide->GeneratePolydataOutputOn();
>>>>>>>>>> //    collide->AddObserver->EndEvent(cbCollision());
>>>>>>>>>>
>>>>>>>>>>    vtkTextActor *txt = vtkTextActor::New();
>>>>>>>>>>
>>>>>>>>>>    vtkSphereSource *point = vtkSphereSource::New();
>>>>>>>>>>    point->SetRadius(0.01);
>>>>>>>>>>    vtkPolyData *pointdata = vtkPolyData::New();
>>>>>>>>>>    pointdata->SetPoints(collide->GetContactPoints());
>>>>>>>>>>
>>>>>>>>>>    vtkGlyph3D *points = vtkGlyph3D::New();
>>>>>>>>>>    points->SetInput(pointdata);
>>>>>>>>>>    points->SetSource(point->GetOutput());
>>>>>>>>>>
>>>>>>>>>>    vtkPolyDataMapper *mapper1 = vtkPolyDataMapper::New();
>>>>>>>>>>    mapper1->SetInput(collide->GetOutput());
>>>>>>>>>>    vtkActor *actor1 = vtkActor::New();
>>>>>>>>>>    actor1->SetMapper(mapper1);
>>>>>>>>>>    (actor1->GetProperty())->BackfaceCullingOn();
>>>>>>>>>>    actor1->SetUserMatrix(matrix0);
>>>>>>>>>>
>>>>>>>>>>    vtkPolyDataMapper *mapper2 = vtkPolyDataMapper::New();
>>>>>>>>>>    mapper2->SetInput(collide->GetOutput(1));
>>>>>>>>>>    vtkActor *actor2 = vtkActor::New();
>>>>>>>>>>    actor2->SetMapper(mapper2);
>>>>>>>>>>    (actor2->GetProperty())->BackfaceCullingOn();
>>>>>>>>>>    actor2->SetUserMatrix(matrix1);
>>>>>>>>>>
>>>>>>>>>>    vtkPolyDataMapper *mapper3 = vtkPolyDataMapper::New();
>>>>>>>>>>    mapper3->SetInput(points->GetOutput());
>>>>>>>>>>    vtkActor *actor3 = vtkActor::New();
>>>>>>>>>>    actor3->SetMapper(mapper3);
>>>>>>>>>>    (actor3->GetProperty())->SetColor(0,0,0);
>>>>>>>>>>
>>>>>>>>>>    vtkRenderer *ren = vtkRenderer::New();
>>>>>>>>>>    ren->AddActor(actor1);
>>>>>>>>>>    ren->AddActor(actor2);
>>>>>>>>>>    //ren AddObserver EndEvent ChangeOrigin
>>>>>>>>>>    //ren AddActor actor3
>>>>>>>>>>    ren->AddActor(txt);
>>>>>>>>>>    ren->SetBackground(0.5,0.5,0.5);
>>>>>>>>>>
>>>>>>>>>>    vtkRenderWindow *renWin = vtkRenderWindow::New();
>>>>>>>>>>    renWin->AddRenderer(ren);
>>>>>>>>>>    vtkInteractorStyleJoystickActor *istyle = 
>>>>>>>>>> vtkInteractorStyleJoystickActor::New();
>>>>>>>>>>    vtkRenderWindowInteractor *iren = 
>>>>>>>>>> vtkRenderWindowInteractor::New();
>>>>>>>>>>    iren->SetRenderWindow(renWin);
>>>>>>>>>>    iren->SetInteractorStyle(istyle);
>>>>>>>>>>
>>>>>>>>>>    iren->Initialize();
>>>>>>>>>>    renWin->Render();
>>>>>>>>>>    iren->Start();
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> If both of your inputs are polydata, this filter might be 
>>>>>>>>>>> useful:
>>>>>>>>>>>
>>>>>>>>>>> http://www.bioengineering-research.com/vtk/vtkCollisionDetectionFilter.htm 
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Apr 2, 2006, at 12:20 AM, Jean-Dominique Barnichon wrote:
>>>>>>>>>>>
>>>>>>>>>>>> One of the surface is not a plane, it is a polyplane (i.e. 
>>>>>>>>>>>> a 2D (xy) polyline extruded along the z direction.
>>>>>>>>>>>> Jean-Do
>>>>>>>>>>>>
>>>>>>>>>>>> Bill Lorensen a écrit :
>>>>>>>>>>>>> If one surface is a plane, you can use ClipPolyData and 
>>>>>>>>>>>>> define an implicit plane as the clipper.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Bill
>>>>>>>>>>>>>
>>>>>>>>>>>>> At 09:13 AM 4/1/2006, Jean-Dominique Barnichon wrote:
>>>>>>>>>>>>>> Dear all,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I need to find the intersection between two surfaces, 
>>>>>>>>>>>>>> each one being defined as a polydata (actually one 
>>>>>>>>>>>>>> surface is a vertical polyplane, and the other one is a 
>>>>>>>>>>>>>> topographical surface).
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Such intersection operation is already effective in other 
>>>>>>>>>>>>>> libraries such as CGAL (http://www.cgal.org) and GTS 
>>>>>>>>>>>>>> (http://gts.sourceforge.net).
>>>>>>>>>>>>>> However, it is still not clear to me which approach i 
>>>>>>>>>>>>>> should follow to perform such an operation with vtk.
>>>>>>>>>>>>>> From what i understood, one can either :
>>>>>>>>>>>>>> - use vtkOBBTree::IntersectWithOBBTree(...), but in this 
>>>>>>>>>>>>>> case the related parameters (especially the 
>>>>>>>>>>>>>> int(*function)) are not obvious to me. Would it be 
>>>>>>>>>>>>>> possible to have a bit more information on this method 
>>>>>>>>>>>>>> and its usage?
>>>>>>>>>>>>>> - treat polydata as an implicit surface using the 
>>>>>>>>>>>>>> vtkImplicitPolydata class (proposed by Dave Pont), which 
>>>>>>>>>>>>>> then allows to use vtkClipPolyData class (though this 
>>>>>>>>>>>>>> class is not part of vtk, yet?).
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Recently, there has been quite few threads related to 
>>>>>>>>>>>>>> very similar topics, but i did not get whether involved 
>>>>>>>>>>>>>> people have eventually succeeded or not in computing the 
>>>>>>>>>>>>>> intersection using one of the above mentioned method.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Any help/advice is welcomed.
>>>>>>>>>>>>>> Thanks in advance
>>>>>>>>>>>>>> Jean-Do
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> 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
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------ 
>>>>>>
>>>>>>
>>>>>> #include "stdafx.h"
>>>>>>
>>>>>> #include "vtkProperty.h"
>>>>>> #include "vtkPolyDataMapper.h"
>>>>>> #include "vtkActor.h"
>>>>>> #include "vtkRenderWindow.h"
>>>>>> #include "vtkRenderWindowInteractor.h"
>>>>>> #include "vtkRenderer.h"
>>>>>> #include "vtkCamera.h"
>>>>>> #include "vtkSphereSource.h"
>>>>>> #include "vtkMatrix4x4.h"
>>>>>> #include "vtkCollisionDetectionFilter.h"
>>>>>> #include "vtkGlyph3D.h"
>>>>>> #include "vtkInteractorStyleJoystickActor.h"
>>>>>> #include "vtkTextActor.h"
>>>>>>
>>>>>> int _tmain(int argc, _TCHAR* argv[])
>>>>>> {
>>>>>>     vtkSphereSource *sphere0 = vtkSphereSource::New();
>>>>>>     sphere0->SetPhiResolution(30);
>>>>>>     sphere0->SetThetaResolution(30);
>>>>>>     sphere0->SetCenter(-0.7, 0, 0);
>>>>>>     sphere0->Update();
>>>>>>
>>>>>>     vtkSphereSource *sphere1 = vtkSphereSource::New();
>>>>>>     sphere1->SetPhiResolution(30);
>>>>>>     sphere1->SetThetaResolution(30);
>>>>>>     sphere1->Update();
>>>>>>
>>>>>>     vtkMatrix4x4 *matrix0 = vtkMatrix4x4::New();
>>>>>>     vtkMatrix4x4 *matrix1 = vtkMatrix4x4::New();
>>>>>>
>>>>>>     vtkCollisionDetectionFilter *collide = 
>>>>>> vtkCollisionDetectionFilter::New();
>>>>>>     collide->SetInput(0, sphere0->GetOutput());
>>>>>>     collide->SetMatrix(0, matrix0);
>>>>>>     collide->SetInput(1, sphere1->GetOutput());
>>>>>>     collide->SetMatrix(1, matrix1);
>>>>>>     collide->SetBoxTolerance(0.0);
>>>>>>     collide->SetCellTolerance(0.0);
>>>>>>     collide->SetNumberOfCellsPerBucket(2);
>>>>>>     //collide->SetCollisionModeToFirstContact();
>>>>>>
>>>>>> // Compiling error as GeneratePolydataOutputOn no longer a method
>>>>>> // so I commented this line
>>>>>> //    collide->GeneratePolydataOutputOn();
>>>>>>
>>>>>> //    collide->AddObserver->EndEvent(cbCollision());
>>>>>>
>>>>>>     vtkTextActor *txt = vtkTextActor::New();
>>>>>>
>>>>>>     vtkSphereSource *point = vtkSphereSource::New();
>>>>>>     point->SetRadius(0.01);
>>>>>>     vtkPolyData *pointdata = vtkPolyData::New();
>>>>>>     pointdata->SetPoints(collide->GetContactPoints());
>>>>>>
>>>>>>     vtkGlyph3D *points = vtkGlyph3D::New();
>>>>>>     points->SetInput(pointdata);
>>>>>>     points->SetSource(point->GetOutput());
>>>>>>
>>>>>>     vtkPolyDataMapper *mapper1 = vtkPolyDataMapper::New();
>>>>>>     mapper1->SetInput(collide->GetOutput());
>>>>>>     vtkActor *actor1 = vtkActor::New();
>>>>>>     actor1->SetMapper(mapper1);
>>>>>>     (actor1->GetProperty())->BackfaceCullingOn();
>>>>>>     actor1->SetUserMatrix(matrix0);
>>>>>>
>>>>>>     vtkPolyDataMapper *mapper2 = vtkPolyDataMapper::New();
>>>>>>     mapper2->SetInput(collide->GetOutput(1));
>>>>>>     vtkActor *actor2 = vtkActor::New();
>>>>>>     actor2->SetMapper(mapper2);
>>>>>>     (actor2->GetProperty())->BackfaceCullingOn();
>>>>>>     actor2->SetUserMatrix(matrix1);
>>>>>>
>>>>>>     vtkPolyDataMapper *mapper3 = vtkPolyDataMapper::New();
>>>>>>     mapper3->SetInput(points->GetOutput());
>>>>>>     vtkActor *actor3 = vtkActor::New();
>>>>>>     actor3->SetMapper(mapper3);
>>>>>>     (actor3->GetProperty())->SetColor(0,0,0);
>>>>>>
>>>>>>     vtkRenderer *ren = vtkRenderer::New();
>>>>>>     ren->AddActor(actor1);
>>>>>>     ren->AddActor(actor2);
>>>>>>     //ren AddObserver EndEvent ChangeOrigin
>>>>>>     //ren AddActor actor3
>>>>>>     ren->AddActor(txt);
>>>>>>     ren->SetBackground(0.5,0.5,0.5);
>>>>>>
>>>>>>     vtkRenderWindow *renWin = vtkRenderWindow::New();
>>>>>>     renWin->AddRenderer(ren);
>>>>>>     vtkInteractorStyleJoystickActor *istyle = 
>>>>>> vtkInteractorStyleJoystickActor::New();
>>>>>>     vtkRenderWindowInteractor *iren = 
>>>>>> vtkRenderWindowInteractor::New();
>>>>>>     iren->SetRenderWindow(renWin);
>>>>>>     iren->SetInteractorStyle(istyle);
>>>>>> //    iren->AddObserver UserEvent {wm deiconify .vtkInteract}
>>>>>>
>>>>>>     iren->Initialize();
>>>>>> //    wm withdraw .
>>>>>>     renWin->Render();
>>>>>>     iren->Start();
>>>>>>
>>>>>> //this callback makes the spheres roll off each other when they 
>>>>>> are rotated.
>>>>>> //proc ChangeOrigin {} {
>>>>>> //    if { (collide->GetNumberOfContacts()) != 0 } {
>>>>>> //        set pts [collide GetContactPoints]
>>>>>> //        set xyz [$pts GetPoint 0]       //        eval actor1 
>>>>>> SetOrigin $xyz
>>>>>> //        eval actor2 SetOrigin $xyz
>>>>>> //    } else {
>>>>>> //        actor1 SetOrigin 0 0 0
>>>>>> //        actor2 SetOrigin 0 0 0
>>>>>> //    }
>>>>>> //}
>>>>>>
>>>>>> //proc cbCollision {} {
>>>>>> //    if {[collide GetNumberOfContacts] > 0} {
>>>>>> //        points Modified
>>>>>> //        txt SetInput "Number of contacts: [collide 
>>>>>> GetNumberOfContacts]"
>>>>>> //        # this *sort of* prevent collisions... not the correct 
>>>>>> way to do it
>>>>>> //        #renWin SetAbortRender 1
>>>>>> //    } else {
>>>>>> //        txt  SetInput "No contacts"
>>>>>> //    }
>>>>>> //}
>>>>>>
>>>>>> //proc PrintContacts {} {
>>>>>> //    for {set i 0} {$i<[collide GetNumberOfContacts]} {incr i} {
>>>>>> //        set cc0 [collide GetContactCells 0] //        set cc1 
>>>>>> [collide GetContactCells 1] //        puts "[$cc0 GetId $i] [$cc1 
>>>>>> GetId $i]"
>>>>>> //    }
>>>>>> //}
>>>>>> }
>>>>>>   
>>>>>
>>>>>
>>>>
>>
>
>




More information about the vtkusers mailing list