<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi all,</div><div><br></div><div>I am trying to generate a triangulated surface from cones and cylinders. Where a cone meets a cylinder I want to clip both surface with each other so they nicely 'touch' each other without .</div><div>However the radius of vtkCylinder doesn't seem to be the same as the radius of vtkCylinderSource.</div><div><br></div><div>The code looks like the following:</div><div><br></div><div>vtkSmartPointer<vtkConeSource> cone = vtkConeSource::New();</div><div>cone->SetResolution(30);</div><div>cone->SetHeight( coneheight );</div><div>cone->SetRadius( coneradius );</div><div>cone->SetCenter( 0.0, 0.5*coneheight, 0.0 ); // so the bottom of the cone of in the x-z plane</div><div>cone->SetDirection( 0.0, 1.0, 0.0 ); // so the cone axis is parallel to y-axis, like with the
cylinder</div><div>cone->CappingOff();<br></div><div><br></div><div>vtkSmartPointer<vtkCylinderSource> cylinder = vtkCylinderSource::New();</div><div>cylinder->SetResolution(30);</div><div>cylinder->SetRadius( cylradius ); // cylradius < coneradius</div><div>cylinder->SetHeight( cyllength );</div><div>cylinder->SetCenter( 0.0, 0.5*cyllength, 0.0 );</div><div>cylinder->CappingOff();</div><div><br></div><div>vtkSmartPointer<vtkCylinder> cyl = vtkCylinder::New();</div><div>cyl->SetRadius( cylradius ); // same value as for vtkCylinderSource</div><div>cyl->SetCenter( 0.0, 0.5*cyllength, 0.0 );</div><div><br></div><div>vtkSmartPointer<vtkClipPolyData> clipper = vtkClipPolyData::New();</div><div>clipper->SetClipFunction( cyl );</div><div>clipper->SetInputConnection( cone->GetOutputPort() );</div><div><br></div><div>vtkSmartPointer<vtkAppendPolyData> append =
vtkAppendPolyData::New();</div><div>append->AddInput( cylinder->GetOutput() );</div><div>append->AddInput( clipper->GetOutput() );</div><div><br></div><div>vtkSmartPointer<vtkPolyDataMapper> mapper = vtkPolyDataMapper::new();</div><div>mapper->SetInput( append->GetOutput() );</div><div><br></div><div>vtkSmartPointer<vtkActor> actor = vtkActor::New();</div><div>actor->SetMapper( mapper );</div><div><br></div><div>actor gets the added to a renderer...</div><div><br></div><div>The radius of the hole in the tip of the cone appears to be smaller than the radius of the cylinder.</div><div>What would be the reason for this?<br></div><div><br></div><div>Thanks - Maarten</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></body></html>