<div dir="ltr"><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Jothy</b> <span dir="ltr">&lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt;</span><br>
Date: Tue, May 18, 2010 at 3:41 PM<br>Subject: Re: [vtkusers] How to create a cube with vtkPolyData<br>To: Scott Johnson &lt;<a href="mailto:Scott.Johnson@neuwave.com">Scott.Johnson@neuwave.com</a>&gt;<br>Cc: VTK &lt;<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>&gt;<br>
<br><br><div dir="ltr">I have tried it earlier. It works fine when you display it as surface. But I want to display it as a wireframe , I mean only the outline.So that you can see the dose values and ROIs properly.<br><br>
(I wonder, there must be someone on the list from the planning system developers, but they keep their mouth tight!).<br>

<br>Thanks,<br><font color="#888888"><br>Jothy</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Tue, May 18, 2010 at 3:26 PM, Scott Johnson <span dir="ltr">&lt;<a href="mailto:Scott.Johnson@neuwave.com" target="_blank">Scott.Johnson@neuwave.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Hello Jothy,</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">It looks like the plane is being rendered as wireframe.  Try
rendering it as a semi-transparent surface to see if it goes away.  I’m not
sure how to get just the outline.</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">                                -- Scott</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;">

<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a>
[mailto:<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a>] <b>On Behalf Of </b>Jothy<br>
<b>Sent:</b> Tuesday, May 18, 2010 5:15 AM<br>
<b>To:</b> David Doria<br>
<b>Cc:</b> VTK<br>
<b>Subject:</b> Re: [vtkusers] How to create a cube with vtkPolyData</span></p>

</div><div><div></div><div>

<p class="MsoNormal"> </p>

<div>

<p class="MsoNormal" style="margin-bottom: 12pt;">Screenshot is here!<br>
<br>
<br>
</p>

<div>

<p class="MsoNormal">On Tue, May 18, 2010 at 11:12 AM, Jothy &lt;<a href="mailto:jothybasu@gmail.com" target="_blank">jothybasu@gmail.com</a>&gt; wrote:</p>

<div>

<p class="MsoNormal">Hi David,<br>
<br>
I tried the vtkHexahedron example. But, when I try to cut this I get a line
across the cut plane . see the screenshot and also the code.<br>
<br>
Could you please figure it out?<br>
<br>
<span style="font-size: 10pt; color: rgb(0, 0, 153);">from vtk import*<br>
<br>
<br>
#Setup the coordinates of eight points<br>
#(the two faces must be in counter clockwise order as viewd from the outside)<br>
P0 = [0.0, 0.0, 0.0];<br>
P1 = [1.0, 0.0, 0.0];<br>
P2 = [1.0, 1.0, 0.0];<br>
P3 = [0.0, 1.0, 0.0];<br>
P4 = [0.0, 0.0, 1.0];<br>
P5 = [1.0, 0.0, 1.0];<br>
P6 = [1.0, 1.0, 1.0];<br>
P7 = [0.0, 1.0, 1.0];<br>
<br>
<br>
#Create the points<br>
points = vtkPoints();<br>
points.InsertNextPoint(P0);<br>
points.InsertNextPoint(P1);<br>
points.InsertNextPoint(P2);<br>
points.InsertNextPoint(P3);<br>
points.InsertNextPoint(P4);<br>
points.InsertNextPoint(P5);<br>
points.InsertNextPoint(P6);<br>
points.InsertNextPoint(P7);<br>
<br>
#Create a hexahedron from the points<br>
hexa = vtkHexahedron();<br>
hexa.GetPointIds().SetId(0,0);<br>
hexa.GetPointIds().SetId(1,1);<br>
hexa.GetPointIds().SetId(2,2);<br>
hexa.GetPointIds().SetId(3,3);<br>
hexa.GetPointIds().SetId(4,4);<br>
hexa.GetPointIds().SetId(5,5);<br>
hexa.GetPointIds().SetId(6,6);<br>
hexa.GetPointIds().SetId(7,7);<br>
<br>
#Add the hexahedron to a cell array<br>
hexs = vtkCellArray();<br>
hexs.InsertNextCell(hexa);<br>
<br>
#Add the points and hexahedron to an unstructured grid<br>
uGrid =vtkUnstructuredGrid();<br>
uGrid.SetPoints(points);<br>
uGrid.InsertNextCell(hexa.GetCellType(), hexa.GetPointIds());<br>
aBeamMapper = vtkDataSetMapper()<br>
aBeamMapper.SetInput(uGrid)<br>
aBeamActor = vtkActor()<br>
aBeamActor.SetMapper(aBeamMapper)<br>
aBeamActor.AddPosition(0,0,0)<br>
aBeamActor.GetProperty().SetColor(1,1,0)<br>
aBeamActor.GetProperty().SetOpacity(0.60)<br>
aBeamActor.GetProperty().EdgeVisibilityOn()<br>
aBeamActor.GetProperty().SetEdgeColor(1,1,1)<br>
aBeamActor.GetProperty().SetLineWidth(1.5)<br>
<br>
#create a plane to cut,here it cuts in the XZ direction (xz normal=(1,0,0);XY
=(0,0,1),YZ =(0,1,0)<br>
plane=vtkPlane()<br>
plane.SetOrigin(0.5,0,0)<br>
plane.SetNormal(1,0,0)<br>
<br>
#create cutter<br>
cutter=vtkCutter()<br>
cutter.SetCutFunction(plane)<br>
cutter.SetInput(aBeamActor.GetMapper().GetInput())<br>
cutter.Update()<br>
cutterMapper=vtkPolyDataMapper()<br>
cutterMapper.SetInputConnection( cutter.GetOutputPort())<br>
<br>
#create plane actor<br>
planeActor=vtkActor()<br>
planeActor.GetProperty().SetColor(1,0.5,0.5)<br>
planeActor.GetProperty().SetLineWidth(2)<br>
planeActor.SetMapper(cutterMapper)<br>
<br>
# Setup a renderer, render window, and interactor<br>
renderer = vtkRenderer()<br>
renderWindow = vtkRenderWindow()<br>
#renderWindow.SetWindowName(&quot;Test&quot;)<br>
<br>
renderWindow.AddRenderer(renderer);<br>
renderWindowInteractor = vtkRenderWindowInteractor()<br>
renderWindowInteractor.SetRenderWindow(renderWindow)<br>
<br>
#Add the actor to the scene<br>
renderer.AddActor(aBeamActor)<br>
renderer.AddActor(planeActor)<br>
renderer.SetBackground(0,0,0) # Background color white<br>
<br>
#Render and interact<br>
renderWindow.Render()<br>
</span><b><i><span style="color: rgb(0, 0, 153);"><br>
</span></i></b><br>
I think it has be passed through a filter. But what it&#39;s that??<br>
<br>
Thanks,<br>
<span style="color: rgb(136, 136, 136);"><br>
Jothy</span></p>

<div>

<div>

<p class="MsoNormal" style="margin-bottom: 12pt;"><br>
<br>
<br>
On Mon, May 17, 2010 at 10:08 PM, David Doria &lt;<a href="mailto:daviddoria%2Bvtk@gmail.com" target="_blank">daviddoria+vtk@gmail.com</a>&gt;
wrote:<br>
&gt; On Mon, May 17, 2010 at 5:03 PM, Jothy &lt;<a href="mailto:jothybasu@gmail.com" target="_blank">jothybasu@gmail.com</a>&gt;
wrote:<br>
&gt;&gt; Hi all,<br>
&gt;&gt;<br>
&gt;&gt; I want to create a hexahedron using vtkPolyData. I think there is no<br>
&gt;&gt; example in wiki. I created it with a vtkHexaHedron but when I cut it<br>
&gt;&gt; it produces a line across the cut section.I don&#39;t want this. I am not<br>
&gt;&gt; able to solve this problem for many months.I used it passing through<br>
&gt;&gt; vtkstripper, vtkTriangle. Finally found that only if the input is of<br>
&gt;&gt; vtkPolyData, cutter will not produce that line across the cut section.<br>
&gt;&gt; Can some with kind enough :), add an example of how to create cube or<br>
&gt;&gt; cone with vtkPoldata.<br>
&gt;&gt;<br>
&gt;&gt; Many thanks,<br>
&gt;&gt;<br>
&gt;&gt; Jothy<br>
&gt;<br>
&gt; I don&#39;t really understand your question. The title and your last<br>
&gt; sentence talk about cubes and cones<br>
&gt;<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK/Examples/GeometricObjects/Cube" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/GeometricObjects/Cube</a><br>
&gt; <a href="http://www.vtk.org/Wiki/VTK/Examples/GeometricObjects/Display/Cone" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/GeometricObjects/Display/Cone</a><br>
&gt;<br>
&gt; but the beginning talks about hexahedrons<br>
&gt;<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK/Examples/GeometricObjects/Hexahedron" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/GeometricObjects/Hexahedron</a><br>
&gt;<br>
&gt; Let us know if these links do not help.<br>
&gt;<br>
&gt; David<br>
&gt;</p>

</div>

</div>

</div>

</div>

<p class="MsoNormal"> </p>

</div>

</div></div></div>

</div>


</blockquote></div><br></div></div></div>
</div><br></div>