<div dir="ltr">So, is there any way to create a hexahedra of shell type?<br><br>Thanks,<br><br>Jothy<br><br><div class="gmail_quote">On Tue, May 18, 2010 at 5:23 PM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.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;">The hexahedra is a solid. The sphere and cube are &quot;shells&quot;. When you<br>
cut the hexahedra you will get interior faces because it is solid.<br>
When you cut the sphere and cube you do not get interior faces because<br>
they are &quot;shells&quot;.<br>
<div><div></div><div class="h5"><br>
On Tue, May 18, 2010 at 11:48 AM, Jothy &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>
&gt; I have a beam passing through the vtkImageData.While I scroll through the<br>
&gt; ImageData it should cut the beam and display it over the imagedata. Please<br>
&gt; see the screenshot.Its simply a beam from the x-ray machine.<br>
&gt;<br>
&gt; I was able to cut spheresource and cube source and able to get contours with<br>
&gt; out this diagonals. But when I try to create it with hexahedron it becomes<br>
&gt; like this.<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Jothy<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Tue, May 18, 2010 at 3:56 PM, Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; If you don&#39;t clip it, you will not see the interior.<br>
&gt;&gt;<br>
&gt;&gt; I am still confused about what you are trying to do.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Tue, May 18, 2010 at 10:41 AM, Jothy &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; I have tried it earlier. It works fine when you display it as surface.<br>
&gt;&gt; &gt; But I<br>
&gt;&gt; &gt; want to display it as a wireframe , I mean only the outline.So that you<br>
&gt;&gt; &gt; can<br>
&gt;&gt; &gt; see the dose values and ROIs properly.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; (I wonder, there must be someone on the list from the planning system<br>
&gt;&gt; &gt; developers, but they keep their mouth tight!).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Jothy<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Tue, May 18, 2010 at 3:26 PM, Scott Johnson<br>
&gt;&gt; &gt; &lt;<a href="mailto:Scott.Johnson@neuwave.com">Scott.Johnson@neuwave.com</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Hello Jothy,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; It looks like the plane is being rendered as wireframe.  Try rendering<br>
&gt;&gt; &gt;&gt; it<br>
&gt;&gt; &gt;&gt; as a semi-transparent surface to see if it goes away.  I’m not sure how<br>
&gt;&gt; &gt;&gt; to<br>
&gt;&gt; &gt;&gt; get just the outline.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;                                 -- Scott<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; From: <a href="mailto:vtkusers-bounces@vtk.org">vtkusers-bounces@vtk.org</a> [mailto:<a href="mailto:vtkusers-bounces@vtk.org">vtkusers-bounces@vtk.org</a>] On<br>
&gt;&gt; &gt;&gt; Behalf<br>
&gt;&gt; &gt;&gt; Of Jothy<br>
&gt;&gt; &gt;&gt; Sent: Tuesday, May 18, 2010 5:15 AM<br>
&gt;&gt; &gt;&gt; To: David Doria<br>
&gt;&gt; &gt;&gt; Cc: VTK<br>
&gt;&gt; &gt;&gt; Subject: Re: [vtkusers] How to create a cube with vtkPolyData<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Screenshot is here!<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Tue, May 18, 2010 at 11:12 AM, Jothy &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Hi David,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I tried the vtkHexahedron example. But, when I try to cut this I get a<br>
&gt;&gt; &gt;&gt; line across the cut plane . see the screenshot and also the code.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Could you please figure it out?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; from vtk import*<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; #Setup the coordinates of eight points<br>
&gt;&gt; &gt;&gt; #(the two faces must be in counter clockwise order as viewd from the<br>
&gt;&gt; &gt;&gt; outside)<br>
&gt;&gt; &gt;&gt; P0 = [0.0, 0.0, 0.0];<br>
&gt;&gt; &gt;&gt; P1 = [1.0, 0.0, 0.0];<br>
&gt;&gt; &gt;&gt; P2 = [1.0, 1.0, 0.0];<br>
&gt;&gt; &gt;&gt; P3 = [0.0, 1.0, 0.0];<br>
&gt;&gt; &gt;&gt; P4 = [0.0, 0.0, 1.0];<br>
&gt;&gt; &gt;&gt; P5 = [1.0, 0.0, 1.0];<br>
&gt;&gt; &gt;&gt; P6 = [1.0, 1.0, 1.0];<br>
&gt;&gt; &gt;&gt; P7 = [0.0, 1.0, 1.0];<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; #Create the points<br>
&gt;&gt; &gt;&gt; points = vtkPoints();<br>
&gt;&gt; &gt;&gt; points.InsertNextPoint(P0);<br>
&gt;&gt; &gt;&gt; points.InsertNextPoint(P1);<br>
&gt;&gt; &gt;&gt; points.InsertNextPoint(P2);<br>
&gt;&gt; &gt;&gt; points.InsertNextPoint(P3);<br>
&gt;&gt; &gt;&gt; points.InsertNextPoint(P4);<br>
&gt;&gt; &gt;&gt; points.InsertNextPoint(P5);<br>
&gt;&gt; &gt;&gt; points.InsertNextPoint(P6);<br>
&gt;&gt; &gt;&gt; points.InsertNextPoint(P7);<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; #Create a hexahedron from the points<br>
&gt;&gt; &gt;&gt; hexa = vtkHexahedron();<br>
&gt;&gt; &gt;&gt; hexa.GetPointIds().SetId(0,0);<br>
&gt;&gt; &gt;&gt; hexa.GetPointIds().SetId(1,1);<br>
&gt;&gt; &gt;&gt; hexa.GetPointIds().SetId(2,2);<br>
&gt;&gt; &gt;&gt; hexa.GetPointIds().SetId(3,3);<br>
&gt;&gt; &gt;&gt; hexa.GetPointIds().SetId(4,4);<br>
&gt;&gt; &gt;&gt; hexa.GetPointIds().SetId(5,5);<br>
&gt;&gt; &gt;&gt; hexa.GetPointIds().SetId(6,6);<br>
&gt;&gt; &gt;&gt; hexa.GetPointIds().SetId(7,7);<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; #Add the hexahedron to a cell array<br>
&gt;&gt; &gt;&gt; hexs = vtkCellArray();<br>
&gt;&gt; &gt;&gt; hexs.InsertNextCell(hexa);<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; #Add the points and hexahedron to an unstructured grid<br>
&gt;&gt; &gt;&gt; uGrid =vtkUnstructuredGrid();<br>
&gt;&gt; &gt;&gt; uGrid.SetPoints(points);<br>
&gt;&gt; &gt;&gt; uGrid.InsertNextCell(hexa.GetCellType(), hexa.GetPointIds());<br>
&gt;&gt; &gt;&gt; aBeamMapper = vtkDataSetMapper()<br>
&gt;&gt; &gt;&gt; aBeamMapper.SetInput(uGrid)<br>
&gt;&gt; &gt;&gt; aBeamActor = vtkActor()<br>
&gt;&gt; &gt;&gt; aBeamActor.SetMapper(aBeamMapper)<br>
&gt;&gt; &gt;&gt; aBeamActor.AddPosition(0,0,0)<br>
&gt;&gt; &gt;&gt; aBeamActor.GetProperty().SetColor(1,1,0)<br>
&gt;&gt; &gt;&gt; aBeamActor.GetProperty().SetOpacity(0.60)<br>
&gt;&gt; &gt;&gt; aBeamActor.GetProperty().EdgeVisibilityOn()<br>
&gt;&gt; &gt;&gt; aBeamActor.GetProperty().SetEdgeColor(1,1,1)<br>
&gt;&gt; &gt;&gt; aBeamActor.GetProperty().SetLineWidth(1.5)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; #create a plane to cut,here it cuts in the XZ direction (xz<br>
&gt;&gt; &gt;&gt; normal=(1,0,0);XY =(0,0,1),YZ =(0,1,0)<br>
&gt;&gt; &gt;&gt; plane=vtkPlane()<br>
&gt;&gt; &gt;&gt; plane.SetOrigin(0.5,0,0)<br>
&gt;&gt; &gt;&gt; plane.SetNormal(1,0,0)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; #create cutter<br>
&gt;&gt; &gt;&gt; cutter=vtkCutter()<br>
&gt;&gt; &gt;&gt; cutter.SetCutFunction(plane)<br>
&gt;&gt; &gt;&gt; cutter.SetInput(aBeamActor.GetMapper().GetInput())<br>
&gt;&gt; &gt;&gt; cutter.Update()<br>
&gt;&gt; &gt;&gt; cutterMapper=vtkPolyDataMapper()<br>
&gt;&gt; &gt;&gt; cutterMapper.SetInputConnection( cutter.GetOutputPort())<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; #create plane actor<br>
&gt;&gt; &gt;&gt; planeActor=vtkActor()<br>
&gt;&gt; &gt;&gt; planeActor.GetProperty().SetColor(1,0.5,0.5)<br>
&gt;&gt; &gt;&gt; planeActor.GetProperty().SetLineWidth(2)<br>
&gt;&gt; &gt;&gt; planeActor.SetMapper(cutterMapper)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; # Setup a renderer, render window, and interactor<br>
&gt;&gt; &gt;&gt; renderer = vtkRenderer()<br>
&gt;&gt; &gt;&gt; renderWindow = vtkRenderWindow()<br>
&gt;&gt; &gt;&gt; #renderWindow.SetWindowName(&quot;Test&quot;)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; renderWindow.AddRenderer(renderer);<br>
&gt;&gt; &gt;&gt; renderWindowInteractor = vtkRenderWindowInteractor()<br>
&gt;&gt; &gt;&gt; renderWindowInteractor.SetRenderWindow(renderWindow)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; #Add the actor to the scene<br>
&gt;&gt; &gt;&gt; renderer.AddActor(aBeamActor)<br>
&gt;&gt; &gt;&gt; renderer.AddActor(planeActor)<br>
&gt;&gt; &gt;&gt; renderer.SetBackground(0,0,0) # Background color white<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; #Render and interact<br>
&gt;&gt; &gt;&gt; renderWindow.Render()<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I think it has be passed through a filter. But what it&#39;s that??<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Thanks,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Jothy<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Mon, May 17, 2010 at 10:08 PM, David Doria<br>
&gt;&gt; &gt;&gt; &lt;<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt; On Mon, May 17, 2010 at 5:03 PM, Jothy &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt; Hi all,<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; I want to create a hexahedron using vtkPolyData. I think there is no<br>
&gt;&gt; &gt;&gt; &gt;&gt; example in wiki. I created it with a vtkHexaHedron but when I cut it<br>
&gt;&gt; &gt;&gt; &gt;&gt; it produces a line across the cut section.I don&#39;t want this. I am<br>
&gt;&gt; &gt;&gt; &gt;&gt; not<br>
&gt;&gt; &gt;&gt; &gt;&gt; able to solve this problem for many months.I used it passing through<br>
&gt;&gt; &gt;&gt; &gt;&gt; vtkstripper, vtkTriangle. Finally found that only if the input is of<br>
&gt;&gt; &gt;&gt; &gt;&gt; vtkPolyData, cutter will not produce that line across the cut<br>
&gt;&gt; &gt;&gt; &gt;&gt; section.<br>
&gt;&gt; &gt;&gt; &gt;&gt; Can some with kind enough :), add an example of how to create cube<br>
&gt;&gt; &gt;&gt; &gt;&gt; or<br>
&gt;&gt; &gt;&gt; &gt;&gt; cone with vtkPoldata.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Many thanks,<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Jothy<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; I don&#39;t really understand your question. The title and your last<br>
&gt;&gt; &gt;&gt; &gt; sentence talk about cubes and cones<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &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;&gt; &gt;&gt; &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;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; but the beginning talks about hexahedrons<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &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;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Let us know if these links do not help.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; David<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt; &gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>