Here is how I do something similar with vtk in python. I have a vtkUnstructuredGrid=uGrid<div><br></div><div><div>        box=vtk.vtkBox()</div><div>        box.SetBounds((X1,X2,Y1,Y2,Z1,Z2)</div><div><br></div><div>        clipper=vtk.vtkClipDataSet()</div>
<div>        clipper.SetInsideOut(0) #where 0 gives all the cells outside of the box, and 1 gives all the cells inside the box.</div><div>        clipper.SetClipFunction(box)</div><div>        clipper.SetInput(
uGrid )</div><div>        </div><div>        clipper.Update()</div><div><br></div><div>        clippedUGrid=clipper.GetOutput()</div><div><br></div><div>So the problem becomes, can we get the shape you want into an implicit function?</div>
<br><div class="gmail_quote">On Wed, Mar 28, 2012 at 9:27 PM, qwcbeyond <span dir="ltr">&lt;<a href="mailto:340181048@qq.com">340181048@qq.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
No. I only want a volume with a hole cut through it and have the same<br>
resolution  with the input volume.<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Cut-volume-with-freehand-curve-tp5600009p5602337.html" target="_blank">http://vtk.1045678.n5.nabble.com/Cut-volume-with-freehand-curve-tp5600009p5602337.html</a><br>

<div class="HOEnZb"><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<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>
</div></div></blockquote></div><br></div>