<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hello Jothy,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>It looks like the plane is being rendered as wireframe.&nbsp; Try
rendering it as a semi-transparent surface to see if it goes away.&nbsp; I&#8217;m not
sure how to get just the outline.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Scott<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> vtkusers-bounces@vtk.org
[mailto:vtkusers-bounces@vtk.org] <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<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>Screenshot is here!<br>
<br>
<br>
<o:p></o:p></p>

<div>

<p class=MsoNormal>On Tue, May 18, 2010 at 11:12 AM, Jothy &lt;<a
href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<o:p></o:p></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:10.0pt;color:#000099'>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:#000099'><br>
</span></i></b><br>
I think it has be passed through a filter. But what it's that??<br>
<br>
Thanks,<br>
<span style='color:#888888'><br>
Jothy</span><o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><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'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'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;<o:p></o:p></p>

</div>

</div>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

</body>

</html>