<!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> </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> </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> </DIV>
<DIV><FONT face=Arial size=2>Thank you for help in advance.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jichang</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </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> </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> </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> </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> </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> quadric
SetCoefficients .5 1 .2 0 .1 0 0 .2 0 0</SPAN></DIV>
<DIV> </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> sample SetSampleDimensions 64 64 30<BR> sample
SetImplicitFunction quadric<BR> sample ComputeNormalsOn</SPAN></DIV>
<DIV> </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># extract SetInput [sample
GetOutput]<BR># extract SetVOI 0 29 0 29 15 15<BR># extract
SetSampleRate 1 2 3</SPAN></DIV>
<DIV> </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> contours SetInput [sample GetOutput]<BR> contours
GenerateValues 5 0.3 0.8</SPAN></DIV>
<DIV> </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> contMapper SetInput [contours GetOutput]<BR>
contMapper SetScalarRange 0.0 1.2</SPAN></DIV>
<DIV> </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> contActor SetMapper contMapper</SPAN></DIV>
<DIV> </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># outline SetInput [sample GetOutput]</SPAN></DIV>
<DIV> </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># outlineMapper SetInput [outline GetOutput]</SPAN></DIV>
<DIV> </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># outlineActor SetMapper outlineMapper<BR># eval
[outlineActor GetProperty] SetColor 0 0 0</SPAN></DIV>
<DIV> </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> renWin AddRenderer
ren1<BR>vtkRenderWindowInteractor iren<BR> iren
SetRenderWindow renWin</SPAN></DIV>
<DIV> </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> </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> </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> </DIV></BODY></HTML>