[vtkusers] vtkLinearExtrusion Cannot extrusion with cap.

dinglw at sei.com.cn dinglw at sei.com.cn
Sun Feb 25 22:08:25 EST 2007


 The Extrusion cann't capped , I don't know why! Could anybody help me?

  //Create Cylinder Section
  vtkPoints *points=vtkPoints::New();
    double rDir = -1.; // Ellipsoidal Head direction
    double rDo, rDi, rH;
    rDi = 40.;

    points->InsertPoint(0, 0., 0,    0);
    points->InsertPoint(1, 0, 100,  0);
    points->InsertPoint(2, 200, 100, 0);
    points->InsertPoint(3, 200, 0,  0);
    points->InsertPoint(4, 0, 0,    0);
  int nPoints=5;
  vtkCellArray *poly=vtkCellArray::New();
    poly->InsertNextCell(nPoints);
    for (int i=0; i<= nPoints; i++)
      {
        poly->InsertCellPoint(i);
      }
  // Construct profile
  vtkPolyData *profile=vtkPolyData::New();
    //profile->SetPolys(poly);
    profile->SetLines(poly);
    profile->SetPoints(points);

  // Extrude profile
  vtkLinearExtrusionFilter *extrude = vtkLinearExtrusionFilter::New();
    extrude->SetCapping(1); 

// The Extrusion cann't capped , I don't know why!


    extrude->SetScaleFactor(10);
    extrude->SetExtrusionTypeToNormalExtrusion();
    extrude->SetInput(profile);




  vtkPolyDataMapper *map=vtkPolyDataMapper::New();
    map->SetInput(extrude->GetOutput());

  vtkActor *pPad = vtkActor::New();
    pPad->SetMapper(map);
    pPad->GetProperty()->SetColor(0,0,1);



  // Render object in current render window
  vtkWindow1->GetRenderer()->AddActor(pPad);

  //Delete object does not used anymore
  pPad->Delete();
  map->Delete();
  extrude->Delete();
  vtkWindow1->GetRenderer()->ResetCamera();
  vtkWindow1->Invalidate();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070226/4f9512ca/attachment.htm>


More information about the vtkusers mailing list