<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Dear All,<br>
<br>
I want to color a cylinder like the image attached. I have tried
combining 2 different cylinder source with different colors but I am
getting the following result<br>
<img src="cid:part1.06010803.00090407@triassicsolutions.com" alt=""><br>
<br>
Any help will be greatly appreciated.<br>
<br>
My source code is as follows:<br>
<br>
vtkCylinderSource catheter = vtkCylinderSource.New();<br>
catheter.SetRadius(1);<br>
catheter.SetHeight(15.0);<br>
catheter.Update();<br>
//catheter.CappingOn();<br>
<br>
vtkFloatArray cylColor1 = vtkFloatArray.New();<br>
cylColor1.SetNumberOfComponents(3);<br>
cylColor1.SetName("Color1");<br>
<br>
for (int i = 0; i <
catheter.GetOutput().GetNumberOfPoints(); i++)<br>
{<br>
cylColor1.InsertTuple3(i, 255, 0, 0);<br>
}<br>
catheter.GetOutput().GetPointData().SetScalars(cylColor1);<br>
<br>
vtkCylinderSource catheter2 = vtkCylinderSource.New();<br>
catheter2.SetRadius(1);<br>
catheter2.SetHeight(10.0);<br>
catheter2.Update();<br>
//catheter2.CappingOn();<br>
<br>
vtkFloatArray cylColor = vtkFloatArray.New();<br>
cylColor.SetNumberOfComponents(3);<br>
cylColor.SetName("Color2");<br>
<br>
for (int i = 0; i <
catheter2.GetOutput().GetNumberOfPoints(); i++)<br>
{<br>
cylColor.InsertTuple3(i, 0, 0, 255);<br>
}<br>
catheter2.GetOutput().GetPointData().SetScalars(cylColor);<br>
<br>
// append both polydata sets<br>
vtkAppendPolyData apd = new vtkAppendPolyData();<br>
apd.AddInput(catheter.GetOutput());<br>
apd.AddInput(catheter2.GetOutput());<br>
apd.Update();<br>
<br>
////vtkCleanPolyData cleanFilter =
vtkCleanPolyData.New();<br>
////cleanFilter.SetInput(apd.GetOutput());<br>
////cleanFilter.Update();<br>
<br>
vtkPolyDataMapper catheterMapper =
vtkPolyDataMapper.New();<br>
catheterMapper.SetInputConnection(apd.GetOutputPort());<br>
catheterActor.SetMapper(catheterMapper);<br>
<br>
<div class="moz-signature">-- <br>
<br>
<font size="2" color="#262626" face="calibri,sans serif,arial">
<div>
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td colspan="2" valign="top" width="230"><span
style="line-height:100%"><font size="2"
color="#262626" face="calibri,sans serif,arial">Regards,<br>
<font color="#5C83B4"><b>DIVYA SADANANDAN<br>
Software Engineer</b></font><br>
Triassic Solutions Pvt. Ltd.<br>
(+91) 471 2700050 (Office)<br>
7736382699 (Mobile)</font></span></td>
</tr>
<tr>
<td valign="top" width="100%"><a
href="http://www.triassicsolutions.com"><img
src="cid:part2.07010205.05000105@triassicsolutions.com"
border="0"></a></td>
</tr>
<tr>
<td><span style="line-height: 75%"><font size="2"
color="#1F497D" face="calibri,sans serif,arial"><br>
Disclaimer: This e-mail contains confidential
information intended solely for the intended
recipient. If you are not the intended recipient,
please notify the sender by e-mail and delete this
email permanently from your records. Do not copy
or distribute this e-mail and any such actions are
unlawful. Except where this email is sent in the
usual course of business, the views expressed in
this email are those of the sender. Triassic
Solutions Pvt. Ltd. accepts no responsibility for
any indirect damage or loss suffered by reason of
inaccuracy or incorrectness of the information in
this email.</font></span><br>
<span><font size="2" color="#33CC00"
face="calibri,sans serif,arial">+ Please consider
our environment before printing this e-mail.</font></span></td>
</tr>
</tbody>
</table>
</div>
</font></div>
</body>
</html>