<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi, All.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>We modified the example Contour2D.tcl to make it 
display 3D contour surface only. It works fine, except some dark triangles 
appear around the OXY, OYZ, or OXZ plane when rotating the 
iso-surface.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Do we need to do more steps to prevent such 
unpleasant appearance? Is it a vtkContourFilter class problem or the vtkCamera 
problem?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thank you for help in advance.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Jichang</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>See the image and our code bellow:</FONT></DIV>
<DIV><FONT face=Arial 
size=2>-----------------------------------------------------------------</FONT></DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><IMG 
height=244 src="cid:00ab01c4ca19$91337bc0$0300a8c0@STARTECH1" width=324 
v:shapes="_x0000_i1025"></SPAN></DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><FONT 
face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><FONT 
face=Arial size=2>--------------- tcl code 
---------------------------------------------</FONT></SPAN></DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"># 
<BR># This example shows some normals of the surfaces could be in wrong<BR># 
direction, resulting dark triagles when rotating the iso-surface</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"># 
This example is made from modification of Contor2d.tcl.<BR># </SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">package 
require vtk<BR>package require vtkinteraction</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"># 
Quadric definition. This is a type of implicit function. Here the <BR># 
coefficients to the equations are set.<BR>vtkQuadric quadric<BR>&nbsp; quadric 
SetCoefficients .5 1 .2 0 .1 0 0 .2 0 0</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"># 
The vtkSampleFunction uses the quadric function and evaluates function<BR># 
value over a regular lattice (i.e., a volume).<BR>vtkSampleFunction 
sample<BR>&nbsp; sample SetSampleDimensions 64 64 30<BR>&nbsp; sample 
SetImplicitFunction quadric<BR>&nbsp; sample ComputeNormalsOn</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"># 
Here a single slice (i.e., image) is extracted from the volume. (Note: in<BR># 
actuality the VOI request causes the sample function to operate on just the<BR># 
slice.)<BR>#vtkExtractVOI extract<BR>#&nbsp; extract SetInput [sample 
GetOutput]<BR>#&nbsp; extract SetVOI 0 29 0 29 15 15<BR>#&nbsp; extract 
SetSampleRate 1 2 3</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"># 
The image is contoured to produce contour lines. Thirteen contour values<BR># 
ranging from (0,1.2) inclusive are produced.<BR>vtkContourFilter 
contours<BR>&nbsp; contours SetInput [sample GetOutput]<BR>&nbsp; contours 
GenerateValues 5 0.3 0.8</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"># 
The contour lines are mapped to the graphics library.<BR>vtkPolyDataMapper 
contMapper<BR>&nbsp; contMapper SetInput [contours GetOutput]<BR>&nbsp; 
contMapper SetScalarRange 0.0 1.2</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">vtkActor 
contActor<BR>&nbsp; contActor SetMapper contMapper</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"># 
Create outline an outline of the sampled data.<BR>#vtkOutlineFilter 
outline<BR>#&nbsp; outline SetInput [sample GetOutput]</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">#vtkPolyDataMapper 
outlineMapper<BR>#&nbsp; outlineMapper SetInput [outline GetOutput]</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">#vtkActor 
outlineActor<BR>#&nbsp; outlineActor SetMapper outlineMapper<BR>#&nbsp; eval 
[outlineActor GetProperty] SetColor 0 0 0</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"># 
Create the renderer, render window, and interactor.<BR>vtkRenderer 
ren1<BR>vtkRenderWindow renWin<BR>&nbsp;&nbsp;&nbsp; renWin AddRenderer 
ren1<BR>vtkRenderWindowInteractor iren<BR>&nbsp;&nbsp;&nbsp; iren 
SetRenderWindow renWin</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"># 
Set the background color to white. Associate the actors with the<BR># 
renderer.<BR>ren1 SetBackground 1 1 1<BR>ren1 AddActor contActor<BR># ren1 
AddActor outlineActor</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"># 
Zoom in a little bit. Associate the Tk interactor popup with a user<BR># 
keypress-u (the UserEvent).<BR>[ren1 GetActiveCamera] Zoom 1.5<BR>iren 
AddObserver UserEvent {wm deiconify .vtkInteract}<BR>iren 
Initialize;</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN lang=EN-US 
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"># 
Don't show the root Tk window "."<BR>wm withdraw .<BR></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BODY></HTML>