<div dir="ltr">Dear VTK list,<div><br></div><div>I want to create a 3D object that looks like an egg/ovoid. I tried to to this with vtkSphere and by setting the vtkTransform->Scale to something like 3,1,1 but it's not working. I would be very glad if you could help me on this. Please find below the code and thank you for any help!</div>
<div><br></div><div><div><br></div><div><div>vtkSphereSource *sSource= vtkSphereSource::New();</div><div> sSource->SetThetaResolution( 12);</div><div> sSource->SetPhiResolution ( 12);</div><div> sSource->SetCenter( 0, 0, 0 );</div>
<div> sSource->SetRadius( 10.0 );</div></div><div><br></div><div><div>vtkTransform* transform = vtkTransform::New();</div><div> transform->Identity();</div><div> transform->Scale(3,1,1);</div><div> transform->Update();</div>
<div> vtkSphere* sphere = vtkSphere::New();</div><div> sphere->SetCenter(0,0,0);</div><div><span style="white-space:pre"> </span>sphere->SetTransform(transform);</div></div><div><br></div><div> vtkSmartPointer<vtkClipPolyData> clipper = vtkSmartPointer<vtkClipPolyData>::New();</div>
<div> clipper->SetInputConnection(sSource->GetOutputPort());</div><div> clipper->SetClipFunction(sphere);</div><div> clipper->SetValue(0);</div><div> clipper->Update();</div><div><br></div><div>
vtkPolyDataMapper *map = vtkPolyDataMapper::New(); </div><div> map->SetInput(clipper->GetOutput());</div><div><br></div><div> vtkActor *aSphere = vtkActor::New(); </div><div> aSphere->SetMapper(map); </div><div>
aSphere->GetProperty()->SetColor(0,0,1); </div></div><div>......</div><div>.....</div><div>.....</div></div>