[vtkusers] Test

Frederic Danesi frederic.danesi at dinccs.com
Tue Jun 23 03:20:53 EDT 2009


Indeed, there is a simple way using a cutter (it may also work with a
clipper). Here is a simple Java example:

 

vtkCutter cutEdges = new vtkCutter();

cutEdges.SetInput(your_object_to_cut);

cutEdges.SetCutFunction(your_cutting_plane); /returns the intersection edges

vtkStripper cutStrips = new vtkStripper();

cutStrips.SetInput(cutEdges.GetOutput());

cutStrips.Update(); 

vtkPolyData cutPoly = new vtkPolyData();

cutPoly.SetPoints(cutStrips.GetOutput().GetPoints());

cutPoly.SetPolys(cutStrips.GetOutput().GetLines()); 

vtkTriangleFilter fillTriangles = new vtkTriangleFilter();

fillTriangles.SetInput(cutPoly); 

 

you will obtain a filled plane 


This example is described in the VTK books (‘clipcow’ example).

 

HTH,

Fred.

 

 

Cordialement,

F.Danesi

-- 

Responsable Développement Informatique et Travail Collaboratif

Département DINCCS (Département Ingénierie Numérique, Conception
Collaborative et Simulation)

MICADO / DINCCS

Pôle de Haute Technologie, BP 90005

08005 Charleville-Mézières Cedex

Tel. : +33 (0) 3.24.41.69.55 / +33 (0) 6.62.76.13.32

Email : frederic.danesi at dinccs.com

Web : www.afmicado.com / www.dinccs.com

 

De : vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] De la part
de Yang, Jinzhong
Envoyé : mardi 23 juin 2009 00:44
À : vtkusers at vtk.org
Objet : Re: [vtkusers] Test

 

Thank you all for your reply. So it works, great! :)

 

Here is my question


 

I have an enclosed surface (in vtkPolyData format) and I use vtkClipPolyData
to clip the surface in a smaller volume. After the clip, I get a surface
that is not closed – it becomes open at the cutting plane. I wonder if there
is any simple method in VTK to make the new surface closed again – maybe
just put some points on the cutting plane and compose some triangular cells.

 

Here is the source code that I used to clip the surface


 

roi_start[3] is the x,y,z values of the starting point of ROI, roi_end[3]
are the x,y,z values of the ending point of ROI.

meshProcessor->GetOutputPort() is an enclosed surface.

 

  double roi_start[3], roi_end[3];

 

  vtkPlanes* BoundingBox = vtkPlanes::New();

  BoundingBox->SetBounds(roi_start[0], roi_end[0], roi_start[1], roi_end[1],
roi_start[2], roi_end[2]);

 

  vtkClipPolyData * clipper = vtkClipPolyData::New();

    

  clipper->SetInputConnection(meshProcessor->GetOutputPort());

  clipper->SetClipFunction(BoundingBox);

  clipper->InsideOutOn();

  clipper->Update();

 

Thanks,

-Jinzhong

 

From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf
Of David Doria
Sent: Monday, June 22, 2009 5:05 PM
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Test

 

On Mon, Jun 22, 2009 at 5:48 PM, Yang, Jinzhong <jinzhong76 at gmail.com>
wrote:

Test if I can send an email to the mailing list. I failed to send my mail to
the list for several times, but I did see my email on the website.

 

Yep, its working.

Thanks,

David 

 

Analyse effectuée par AVG - www.avg.fr
Version: 8.5.374 / Base de données virale: 270.12.85/2193 - Date: 06/21/09
20:02:00

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090623/240a782e/attachment.htm>


More information about the vtkusers mailing list