<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006>Greetings VTK users,</SPAN></FONT></FONT></DIV>
<DIV><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006></SPAN></FONT></FONT>&nbsp;</DIV>
<DIV><FONT><SPAN class=593143318-21042006></SPAN><FONT face="Courier New"><FONT 
size=2><SPAN class=593143318-21042006>I am new to VTK, and this is my first time 
addressing this&nbsp;forum, so please forgive any obvious 
questions.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006>I need to make a plane with a lot of holes in it, which 
I managed to do using the vtkClipPolyData 
function.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006>I combined all the implicit cylinders together with a 
vtkImplicitBoolean (union) and fed the result to the 
clipper.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006>The problem is that it is too slow for my intended 
purpose.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006>Anyone have any ideas to speed up this 
task?</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006>Sample Java code is listed 
below.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006>Many thanks,</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006>Cordially,</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006>Tim</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006>***********************************************************************************88</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT><FONT face="Courier New"><FONT size=2><SPAN 
class=593143318-21042006></SPAN>//<BR>//This example&nbsp;<SPAN 
class=593143318-21042006>creates a plane pierced by 380 
holes</SPAN>&nbsp;<BR>//<BR>//</FONT></FONT></FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>//we import the vtk wrapped classes f<SPAN 
class=593143318-21042006>i</SPAN>rst<BR>import java.util.Vector;</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>import vtk.*;</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>//then we define our class<BR>public class 
Main {<BR>// in the static contructor we load in the native code<BR>// The 
libraries must be in your path to work<BR>static { 
<BR>&nbsp;System.loadLibrary("vtkCommonJava"); 
<BR>&nbsp;System.loadLibrary("vtkFilteringJava"); 
<BR>&nbsp;System.loadLibrary("vtkIOJava"); 
<BR>&nbsp;System.loadLibrary("vtkImagingJava"); 
<BR>&nbsp;System.loadLibrary("vtkGraphicsJava"); 
<BR>&nbsp;System.loadLibrary("vtkRenderingJava"); <BR>}</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>// now the main program<BR>public static 
void main (String []args) throws Exception {<BR>&nbsp;<BR>&nbsp;&nbsp;final 
double planeHeight = .28;<BR>&nbsp;&nbsp;final double planeWidth = 
.22;<BR>&nbsp;&nbsp;final int holeCnt = 380;<BR>&nbsp;&nbsp;final int rowCount = 
38;<BR>&nbsp;&nbsp;final double holeRadius = 0.0025;<BR>&nbsp;&nbsp;final double 
offsetFromTop = 0.005;<BR>&nbsp;&nbsp;final double offsetFromSide = 
0.01075;<BR>&nbsp;&nbsp;final double holeSpacing = .00725;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;<BR>&nbsp;&nbsp;&nbsp; &nbsp;<BR>&nbsp;&nbsp;vtkPlaneSource planeSource = 
new 
vtkPlaneSource();<BR>&nbsp;&nbsp;planeSource.SetOrigin(0,-planeHeight/2,0);<BR>&nbsp;&nbsp;planeSource.SetPoint1(planeWidth,-planeHeight/2,0);<BR>&nbsp;&nbsp;planeSource.SetPoint2(0,planeHeight/2,0);<BR>&nbsp;&nbsp;planeSource.SetResolution(200,200);<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;vtkPolyDataMapper 
planeMapper = new vtkPolyDataMapper();</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;Vector &lt;vtkCylinder&gt; 
holeList = new 
Vector&lt;vtkCylinder&gt;(holeCnt);<BR>&nbsp;&nbsp;vtkGeneralTransform trans = 
new 
vtkGeneralTransform();<BR>&nbsp;&nbsp;trans.RotateX(90);<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;vtkImplicitBoolean 
holes = new 
vtkImplicitBoolean();<BR>&nbsp;&nbsp;holes.SetOperationTypeToUnion();<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for 
(int i= 0 ; i&lt;holeCnt; i++)<BR>&nbsp;&nbsp;&nbsp; &nbsp;{<BR><SPAN 
class=593143318-21042006>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>double currentOffsetFromTop = -planeHeight/2 + offsetFromTop + 
i%rowCount*holeSpacing;<BR><SPAN 
class=593143318-21042006>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>holeList.insertElementAt(new vtkCylinder(), i);<BR><SPAN 
class=593143318-21042006>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>holeList.elementAt(i).SetCenter(offsetFromSide*(i/rowCount+1), 0, 
currentOffsetFromTop);<BR><SPAN 
class=593143318-21042006>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>holeList.elementAt(i).SetRadius(holeRadius);<BR><SPAN 
class=593143318-21042006>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>holeList.elementAt(i).SetTransform(trans);<BR><SPAN 
class=593143318-21042006>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>holes.AddFunction(holeList.elementAt(i));<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;}&nbsp;&nbsp;&nbsp; &nbsp;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;<BR>&nbsp;&nbsp;&nbsp; &nbsp;vtkClipPolyData planeClipper = new 
vtkClipPolyData();<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;planeClipper.InsideOutOn();<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;planeClipper.SetInput(planeSource.GetOutput());<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;planeClipper.SetClipFunction(holes);<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;planeClipper.GenerateClippedOutputOn();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkPolyData 
planePolyData = planeClipper.GetClippedOutput();&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp;&nbsp; 
planeMapper.SetInput(planePolyData);<BR>&nbsp;&nbsp;&nbsp;&nbsp; vtkActor 
planeActor = new vtkActor();<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
planeActor.SetMapper(planeMapper);<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp; vtkRenderer ren1 = new 
vtkRenderer();<BR>&nbsp;&nbsp;&nbsp;&nbsp; ren1.SetBackground(0.1, 0.2, 
0.4);<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
ren1.AddActor(planeActor);<BR>&nbsp;//<BR>&nbsp;// Finally we create the render 
window which will show up on the screen.<BR>&nbsp;// We add our two renderers 
into the render window using AddRenderer. We also<BR>&nbsp;// set the size to be 
600 pixels by 300.<BR>&nbsp;//<BR>&nbsp;vtkRenderWindow renWin = new 
vtkRenderWindow();<BR>&nbsp;renWin.AddRenderer( ren1 
);<BR>&nbsp;renWin.SetSize(600, 600);</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" 
size=2>&nbsp;ren1.GetActiveCamera().Azimuth(0);</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;vtkRenderWindowInteractor iren = new 
vtkRenderWindowInteractor();<BR>&nbsp;iren.SetRenderWindow(renWin);</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;vtkInteractorStyleTrackballCamera 
style = <BR>&nbsp;&nbsp;&nbsp;&nbsp; new 
vtkInteractorStyleTrackballCamera();<BR>&nbsp;iren.SetInteractorStyle(style);</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" 
size=2>&nbsp;iren.Initialize();<BR>&nbsp;iren.Start();<BR>&nbsp;}<BR>}<BR></FONT></DIV></BODY></HTML>