<HTML><HEAD><TITLE>Mail</TITLE>
<META name=GENERATOR 
content="KsDHTMLEDLib.ocx, FreeWare HTML Editor 1.164.2, ?Kurt Senfer">
<META content="text/html; charset=GB2312" http-equiv=Content-Type></HEAD>
<BODY style="FONT-FAMILY: РВЛОМе; FONT-SIZE: 9pt" leftMargin=5 topMargin=5 #ffffff>
<DIV><FONT style="BACKGROUND-COLOR: #cce8cf">Thanks for your 
answer.</FONT></DIV>
<DIV><FONT style="BACKGROUND-COLOR: #cce8cf">Yes, I also&nbsp;have tried to clip 
polydata, not normals.</FONT></DIV>
<DIV><FONT style="BACKGROUND-COLOR: #cce8cf">But the result's color is just not 
same as the original model.</FONT></DIV>
<DIV><FONT style="BACKGROUND-COLOR: #cce8cf">So I think maybe it is my model's 
problem,because the model is converted from a vrml model. </FONT></DIV>
<DIV><FONT style="BACKGROUND-COLOR: #cce8cf">I used vtkTableBasedClipDataSet, 
and the color is right. I was confused.</FONT></DIV>
<DIV><FONT style="BACKGROUND-COLOR: #cce8cf">And when treat it as a DataSet with 
normals, the color is right. </FONT></DIV>
<DIV>Do you know the reason?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thank you very much!</DIV>
<DIV>
<DIV>2012/12/13 </DIV><A 
href="mailto:gongweixue@sina.com">gongweixue@sina.com</A></DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
  <DIV 
  style="LINE-HEIGHT: normal; FONT-VARIANT: normal; FONT-STYLE: normal; FONT-SIZE: 9pt; FONT-WEIGHT: normal">----- 
  Original Message ----- </DIV>
  <DIV 
  style="LINE-HEIGHT: normal; FONT-VARIANT: normal; FONT-STYLE: normal; BACKGROUND: #e4e4e4; FONT-SIZE: 9pt; FONT-WEIGHT: normal; font-color: black"><B>From: 
  </B><A href="mailto:alexmalvtk@gmail.com">Alex Malyushytskyy</A> </DIV>
  <DIV 
  style="LINE-HEIGHT: normal; FONT-VARIANT: normal; FONT-STYLE: normal; FONT-SIZE: 9pt; FONT-WEIGHT: normal"><B>To: 
  </B><A href="mailto:vtkusers@vtk.org">vtkusers</A> </DIV>
  <DIV 
  style="LINE-HEIGHT: normal; FONT-VARIANT: normal; FONT-STYLE: normal; FONT-SIZE: 9pt; FONT-WEIGHT: normal"><B>Date: 
  </B>2012-12-13, 07:34:12</DIV>
  <DIV 
  style="LINE-HEIGHT: normal; FONT-VARIANT: normal; FONT-STYLE: normal; FONT-SIZE: 9pt; FONT-WEIGHT: normal"><B>Subject: 
  </B>Re: [vtkusers] Problem with color after using vtkClipPolyData</DIV>
  <DIV><BR></DIV>
  <DIV></DIV>
  <DIV></DIV>
  <DIV>
  <DIV>Self-sufficient example would help.<BR>As is I can only guess that you 
  probably did not want to clip normal<BR>as you currently do<BR>and wanted to 
  clip read 
  polydata:<BR><BR>&nbsp;clipper-&gt;SetInput(reader-&gt;GetOutput());<BR><BR>Alex<BR><BR>On 
  Tue, Dec 11, 2012 at 10:18 PM, gongweixue &lt;<A 
  href="mailto: gongweixue@sina.com">gongweixue@sina.com</A>&gt; wrote:<BR>&gt; 
  hi guys,<BR>&gt; I used a vtkClipPolyData to clip polydata, and I found that 
  the color of<BR>&gt; surfaces after clipping is changed.<BR>&gt; So,dose 
  anybody know the reason?<BR>&gt; here is my code.<BR>&gt;<BR>&gt; 
  //////////////////////code/////////////////////////////<BR>&gt; 
  vtkPolyDataReader *reader=vtkPolyDataReader::New();<BR>&gt; 
  reader-&gt;SetFileName(FILENAME);<BR>&gt; reader-&gt;Update();<BR>&gt;<BR>&gt; 
  vtkClipPolyData * clipper=vtkClipPolyData::New();<BR>&gt; 
  clipper-&gt;SetInput(normals-&gt;GetOutput());<BR>&gt; vtkPlane * plane = 
  vtkPlane::New();<BR>&gt; plane-&gt;SetOrigin(0.5,0,0);<BR>&gt; 
  plane-&gt;SetNormal(1,1,1);<BR>&gt; 
  clipper-&gt;SetClipFunction(plane);<BR>&gt; clipper-&gt;SetValue(0.5);<BR>&gt; 
  clipper-&gt;SetInsideOut(1);<BR>&gt; clipper-&gt;Update();<BR>&gt;<BR>&gt; 
  vtkPolyDataMapper *mapper=vtkPolyDataMapper::New();<BR>&gt; 
  mapper-&gt;SetInput(clipper-&gt;GetOutput());<BR>&gt; vtkActor 
  *actor=vtkActor::New();<BR>&gt; actor-&gt;SetMapper(mapper);<BR>&gt; 
  vtkRenderer *ren1= vtkRenderer::New();<BR>&gt; ren1-&gt;AddActor( actor 
  );<BR>&gt; ren1-&gt;SetBackground( 0.1, 0.2, 0.4 );<BR>&gt; vtkRenderWindow 
  *renWin = vtkRenderWindow::New();<BR>&gt; renWin-&gt;AddRenderer( ren1 
  );<BR>&gt; renWin-&gt;SetSize( 600, 600 );<BR>&gt; vtkRenderWindowInteractor 
  *iren = vtkRenderWindowInteractor::New();<BR>&gt; 
  iren-&gt;SetRenderWindow(renWin);<BR>&gt; vtkInteractorStyleTrackballCamera 
  *style =<BR>&gt; vtkInteractorStyleTrackballCamera::New();<BR>&gt; 
  iren-&gt;SetInteractorStyle(style);<BR>&gt; iren-&gt;Initialize();<BR>&gt; 
  iren-&gt;Start();<BR>&gt; 
  ///////////////////////////////////////////////<BR>&gt; And here is the 
  pic:<BR>&gt; <A 
  href="http://p13.freep.cn/p.aspx?u=v20_p13_photo_1212121410379520_0.jpg">http://p13.freep.cn/p.aspx?u=v20_p13_photo_1212121410379520_0.jpg</A><BR>&gt;<BR>&gt; 
  I will appreciate any suggestion very much!<BR>&gt;<BR>&gt;<BR>&gt; 
  _______________________________________________<BR>&gt; Powered by 
  www.kitware.com<BR>&gt;<BR>&gt; Visit other Kitware open-source projects 
  at<BR>&gt; <A 
  href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</A><BR>&gt;<BR>&gt; 
  Please keep messages on-topic and check the VTK FAQ at:<BR>&gt; <A 
  href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</A><BR>&gt;<BR>&gt; 
  Follow this link to subscribe/unsubscribe:<BR>&gt; <A 
  href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>&gt;<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">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">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">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR><BR></DIV></DIV></BLOCKQUOTE></BODY></HTML>