the vtk not have a class for that?<br><br><div class="gmail_quote">2008/5/5 Paulo Henrique Junqueira Amorim <<a href="mailto:paulojamorim@gmail.com">paulojamorim@gmail.com</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>Anyone have any ideas?<br><br>Regards,<br>Paulo<br><br><br><div class="gmail_quote">2008/5/2 Paulo Henrique Junqueira Amorim <<a href="mailto:paulojamorim@gmail.com" target="_blank">paulojamorim@gmail.com</a>>:<div>
<div></div><div class="Wj3C7c"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Mathieu,<br><br>Thank but the vtkImplicitPolyData only works in vtk 4.2, my project uses vtk 5.1 and wrapper to Python.<br><br>I tried to convert PolyData implicit function and then use the
vtkImplicitBoolean but the output of vtkImplicitBoolean is null, I am exported to stl and export null, I am creted Actor and Add renderer, but the output of the renderer is black. See below code.<br><br>Best Regards,<br>
Paulo Amorim<br><br><br>
The code convert PolyData in Implicit Function:<br>
<br>from vtk import *<br><br>#To test PolyData Boolean<br>Cylinder = vtkCylinderSource()<br>Cylinder.SetHeight(35)<br>Cylinder.SetRadius(6)<br><br>Cube = vtkCubeSource()<br>Cube.SetXLength(100)<br>Cube.SetYLength(10)<br>
Cube.SetZLength(10)<br><br><br><br># transforming polyData of the Cylinder to an implicitFunction<br>poly_Cylinder = vtkPolyData()<br>poly_Cylinder.SetPoints(Cylinder.GetOutput().GetPoints())<br><br>tri_Cylinder = vtkTriangleFilter()<br>
tri_Cylinder.SetInput(poly_Cylinder)<br><br>implicit_Cylinder = vtkImplicitModeller()<br>implicit_Cylinder.SetInputConnection(tri_Cylinder.GetOutputPort())<br><br>dataset_Cylinder = vtkImplicitDataSet()<br>dataset_Cylinder.SetDataSet(implicit_Cylinder.GetOutput())<br>
<br><br><br># ---- transforming polyData of the Cube to an implicitFunction -----------<br>poly_Cube = vtkPolyData()<br>poly_Cube.SetPoints(Cube.GetOutput().GetPoints())<br><br>tri_Cube = vtkTriangleFilter()<br>tri_Cube.SetInput(poly_Cube)<br>
<br>implicit_Cube = vtkImplicitModeller()<br>implicit_Cube.SetInputConnection(tri_Cube.GetOutputPort())<br><br>dataset_Cube = vtkImplicitDataSet()<br>dataset_Cube.SetDataSet(implicit_Cube.GetOutput())<br><br><br>#Boolean Difference two implicit funcion (cylinder and cube)<br>
<br>implict_Boolean = vtkImplicitBoolean()<br>implict_Boolean.SetOperationTypeToDifference()<br><br>implict_Boolean.AddFunction(dataset_Cube)<br>implict_Boolean.AddFunction(dataset_Cylinder)<br><br><br>Sample = vtkSampleFunction()<br>
Sample.SetImplicitFunction(implict_Boolean)<br><br>Surface = vtkContourFilter()<br>Surface.SetInputConnection(Sample.GetOutputPort())<br><br><br>#Export to STL<br>writerBinary = vtkSTLWriter()<br>writerBinary.SetFileName("c:\\exported.stl")<br>
writerBinary.SetInput(Surface.GetOutput())<br>writerBinary.SetFileType(2)<br>writerBinary.Write()<br><br><br><br>Mapper = vtkPolyDataMapper()<br>Mapper.SetInput(Surface.GetOutput())<br>Mapper.ScalarVisibilityOn()<br><br>
Actor = vtkActor()<br>
Actor.SetMapper(Mapper)<br>Actor.SetPosition(0,0,0)<br><br><br>ren = vtkRenderer()<br>ren.AddActor(Actor)<br><br>renWin = vtkRenderWindow()<br>renWin.AddRenderer(ren)<br><br>iren = vtkRenderWindowInteractor()<br>iren.SetRenderWindow(renWin)<br>
<br>renWin.Render()<br><br><br><br><br><div class="gmail_quote">2008/4/28 Mathieu Malaterre <<a href="mailto:mathieu.malaterre@gmail.com" target="_blank">mathieu.malaterre@gmail.com</a>>:<div><div></div><div>
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Paulo,<br>
<br>
I believe this question has been raised in the vtkusers mailing list<br>
before, how about:<br>
<br>
<a href="http://www.vtk.org/pipermail/vtkusers/2007-April/090730.html" target="_blank">http://www.vtk.org/pipermail/vtkusers/2007-April/090730.html</a><br>
<br>
HTH<br>
-Mathieu<br>
<div><div></div><div><br>
On Sun, Apr 27, 2008 at 3:44 AM, Paulo Henrique Junqueira Amorim<br>
<<a href="mailto:paulojamorim@gmail.com" target="_blank">paulojamorim@gmail.com</a>> wrote:<br>
> Hi All,<br>
><br>
> I am researching how to make operation of intersseção and subtraction of<br>
> PolyData with the vtk 5. But I do not think any refence.<br>
><br>
> That class could use?<br>
><br>
><br>
> Best Regards,<br>
> Paulo<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> This is the private VTK discussion list.<br>
> Please keep messages on-topic. Check the FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
<font color="#888888">Mathieu<br>
</font></blockquote></div></div></div><br>
</blockquote></div></div></div><br>
</blockquote></div><br>