<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>I've done some more testing; seems that when I set the radius of the vtkCylinder equal to the radius of the cones, both cones are totally clipped away (setting InsideOutOn keeps both cones in the scene). Does this mean there is something wrong with (my use of) vtkCylinderSource?<br></span></div><div><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Maarten Beek <beekmaarten@yahoo.com><br><b><span style="font-weight: bold;">To:</span></b> "vtkusers@vtk.org" <vtkusers@vtk.org><br><b><span style="font-weight: bold;">Sent:</span></b> Thursday, September 1, 2011 12:49:07 PM<br><b><span
style="font-weight: bold;">Subject:</span></b> [vtkusers] Radii of vtkCylinder and vtkCylinderSource are different?<br></font><br><meta http-equiv="x-dns-prefetch-control" content="off"><div id="yiv619437818"><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></div><meta http-equiv="x-dns-prefetch-control"
content="on"><br>_______________________________________________<br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br><br></div></div></div></body></html>