<div class="gmail_quote">On Tue, Mar 2, 2010 at 1:31 PM, Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">Well, this isn't perfect, but here's a slightly modified example (sorry, this time in python) which clips the sphere with the cube. You need _some_ scalars associated with the geometry used for the implicit function, and the evaluation of what is inside and what is outside the shape only really works if the shape used for the implicit function has 3D cells (not just polygonal cells on the surface), so I used vtkDelaunay3D to create these cells in the cube. This might not work well if the shape you're clipping with isn't convex...<div>
<br></div><div><a href="http://www.vtk.org/Wiki/VTK/Examples/Python/vtkImplicitDataSet" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Python/vtkImplicitDataSet</a></div><div><br></div><div>You can see from the screen shot there that cells on the sphere aren't split by the clip.</div>
<div><br></div><div>Hope this gets you a little further. It still may be worth checking out GTS for real boolean operations if someone else doesn't have a cleaner way of doing the same within VTK.</div><div><br></div>
<div>-Eric</div><div></div></div></blockquote></div><br><div>Here it is in c++:</div><div><a href="http://www.vtk.org/Wiki/VTK/Examples/ImplicitDataSet">http://www.vtk.org/Wiki/VTK/Examples/ImplicitDataSet</a></div><div><br>
</div><div>The higher the resolution of your model, the less these artifacts are noticeable. </div><div><br></div><div>Eric - can you explain in a bit more detail what the scalars from the elevation filter do? For example, could we just use all 1's in an array in PointData?</div>
<div><br clear="all">Thanks,<br><br>David<br></div>