<div dir="ltr"><div>Hi, try inverting the normal of the plane<br><br>clipPlane.SetNormal(0,0,-1)<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-09-02 11:48 GMT+02:00 sdpkrshnn <span dir="ltr"><<a href="mailto:sdpkrshnn@gmail.com" target="_blank">sdpkrshnn@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
I am Cutting a mesh using vtkClipClosedSurface but it is always keeping one<br>
part and i need get the other part which is cropped ,my code is here below<br>
<br>
quad = vtk.vtkSTLReader()<br>
quad.SetFileName(vtkFile)<br>
quad.Update()<br>
mesh = quad.GetOutput()<br>
<br>
clipPlane = vtk.vtkPlane()<br>
clipPlane.SetOrigin(0,0,-54.<wbr>3772147817)<br>
clipPlane.SetNormal(0,0,1)<br>
<br>
centerFilter = vtk.vtkCenterOfMass()<br>
centerFilter.SetInput(mesh)<br>
centerFilter.<wbr>SetUseScalarsAsWeights(False)<br>
centerFilter.Update()<br>
center = centerFilter.GetCenter()<br>
print center<br>
<br>
transform = vtk.vtkTransform()<br>
transform.Translate(-center[0]<wbr>, -center[1], -center[2])<br>
transformFilter = vtk.<wbr>vtkTransformPolyDataFilter()<br>
transformFilter.SetInput(mesh)<br>
transformFilter.SetTransform(<wbr>transform)<br>
transformFilter.Update()<br>
centeredPolydata = transformFilter.GetOutput()<br>
<br>
clip = vtk.vtkClipClosedSurface()<br>
clip.SetInputConnection(<wbr>transformFilter.GetOutputPort(<wbr>))<br>
planes = vtk.vtkPlaneCollection()<br>
planes.AddItem(clipPlane)<br>
clip.SetTolerance(10e-3)<br>
clip.SetClippingPlanes(planes)<br>
clip.Update()<br>
mesh = clip.GetOutput()<br>
<br>
polyWriter = vtk.vtkSTLWriter()<br>
polyWriter.SetInput(mesh)<br>
polyWriter.SetFileName(<wbr>vtkfile)<br>
polyWriter.Write()<br>
<br>
Can any one suggest any dolution<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/how-to-get-the-other-part-from-vtkclipclosedsurface-tp5740105.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.<wbr>com/how-to-get-the-other-part-<wbr>from-vtkclipclosedsurface-<wbr>tp5740105.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>