[vtkusers] question about implicit surfaces and extractPolyDataGeometry - trying to produce a triangle mesh of a cylinder

Audette, Michel A. maudette at odu.edu
Thu Jul 18 14:52:45 EDT 2013


Dear VTK users,

I would like to use a cylindrical implicit function in order to produce a triangulated cylindrical mesh. Looking at the testing example extractPolyData.tcl , which includes the code below, I see both a cylindrical function used as implicit function, as well as a sphere source which is used in conjunction with SetInputConnection. Can someone illuminate me on what purpose is served by the latter?

If not, how can I produce a triangulated surface mesh of a cylinder, e.g. vtkCylinder?

Here is the relevant code in the tcl test file.

vtkSphereSource sphere
  sphere SetThetaResolution 8
  sphere SetPhiResolution 16
  sphere SetRadius 1.5

# Extraction stuff
vtkTransform t
    t RotateX 90
vtkCylinder cylfunc
    cylfunc SetRadius 0.5
    cylfunc SetTransform t
vtkExtractPolyDataGeometry extract
    extract SetInputConnection [sphere GetOutputPort]
    extract SetImplicitFunction cylfunc
    extract ExtractBoundaryCellsOn

vtkPolyDataMapper  sphereMapper
    sphereMapper SetInputConnection [extract GetOutputPort]
    sphereMapper GlobalImmediateModeRenderingOn

vtkActor sphereActor
    sphereActor SetMapper sphereMapper

Thanks for your support.

Michel
Michel Audette, Ph.D.
Assistant Professor,
Department of Modeling, Simulation and Visualization Engineering,
Old Dominion University,
Norfolk, VA.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130718/9c7814a2/attachment.htm>


More information about the vtkusers mailing list