<div dir="ltr"><div>I assume this is failing even with the crash fix recently merged to master?</div><div><br></div>Do you have data sets you can share to reproduce the problem?<div><br></div><div>Thanks,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 8, 2015 at 2:34 PM, normanius <span dir="ltr"><<a href="mailto:juch@zhaw.ch" target="_blank">juch@zhaw.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
For two polydata objects I create boolean operations, and /often/ this does<br>
not cause any problems. However, /sometimes/ I get results as seen in the<br>
image below. The second image shows that there are indeed non-manifold edges<br>
resulting from the operations.<br>
<br>
I verified that the input objects are manifold.<br>
<br>
I came across  this<br>
<<a href="http://vtk.1045678.n5.nabble.com/Non-manifold-triangles-after-running-vtkBooleanOperationPolydataFilter-td5713964.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/Non-manifold-triangles-after-running-vtkBooleanOperationPolydataFilter-td5713964.html</a>><br>
post where Cory Quammen states it might be related to a bug in the<br>
algorithm.<br>
<br>
(I've cross-posted the problem also on  Stackoverflow<br>
<<a href="http://stackoverflow.com/questions/34100211" rel="noreferrer" target="_blank">http://stackoverflow.com/questions/34100211</a>>  , but I found that I reach<br>
the vtk cracks much more efficiently through this mailing list.)<br>
<br>
I'm calling the following code:<br>
<br>
def doApplyCutAdvanced(source, cutCylinder, domeCutCenter):<br>
    '''<br>
    Cut a cylinder B from source A according to the following recipe:<br>
    A = A \ B<br>
    A = connectivityFilter(A, domeCenter)<br>
    A = A v (A ^ B)<br>
    '''<br>
<br>
    # Extract triangles.<br>
    sourceTriangles = vtk.vtkTriangleFilter()<br>
    sourceTriangles.SetInputConnection(source.GetOutputPort())<br>
    sourceTriangles.Update()<br>
<br>
    cylinderTriangles = vtk.vtkTriangleFilter()<br>
    cylinderTriangles.SetInputConnection(cutCylinder.GetOutputPort())<br>
    cylinderTriangles.Update()<br>
<br>
    # First operation: A \ B<br>
    operation1 = vtk.vtkBooleanOperationPolyDataFilter()<br>
    operation1.SetOperationToDifference()<br>
    operation1.SetInputConnection(0, sourceTriangles.GetOutputPort())<br>
    operation1.SetInputConnection(1, cylinderTriangles.GetOutputPort())<br>
    operation1.Update()<br>
<br>
    # Second operation: A ^ B<br>
    operation2 = vtk.vtkBooleanOperationPolyDataFilter()<br>
    operation2.SetOperationToIntersection()<br>
    operation2.SetInputConnection(0, source.GetOutputPort())<br>
    operation2.SetInputConnection(1, cylinderTriangles.GetOutputPort())<br>
    operation2.Update()<br>
<br>
    # Apply the cut.<br>
    cutSurfaceConnected = vtk.vtkPolyDataConnectivityFilter()<br>
    cutSurfaceConnected.SetInputConnection(operation1.GetOutputPort())<br>
    cutSurfaceConnected.SetExtractionModeToClosestPointRegion()<br>
    cutSurfaceConnected.SetClosestPoint(domeCutCenter)<br>
    cutSurfaceConnected.Update()<br>
<br>
    # Fix up the source object (if it was cut partially by the cylinder)<br>
    appendFilter = vtk.vtkAppendPolyData()<br>
    if vtk.vtkVersion.GetVTKMajorVersion() == 5:<br>
        appendFilter.AddInput(cutSurfaceConnected.GetOutput())<br>
        appendFilter.AddInput(operation2.GetOutput())<br>
    else:<br>
        appendFilter.AddInputData(cutSurfaceConnected.GetOutput())<br>
        appendFilter.AddInputData(operation2.GetOutput())<br>
    appendFilter.Update()<br>
<br>
    cutSurfaceRepaired = vtk.vtkCleanPolyData()<br>
    cutSurfaceRepaired.SetInputConnection(appendFilter.GetOutputPort())<br>
    cutSurfaceRepaired.Update()<br>
<br>
    cutSurfaceRepairedTriangles = vtk.vtkTriangleFilter()<br>
<br>
cutSurfaceRepairedTriangles.SetInputConnection(cutSurfaceRepaired.GetOutputPort())<br>
    cutSurfaceRepairedTriangles.Update()<br>
<br>
    return cutSurfaceRepairedTriangles<br>
<br>
<<a href="http://vtk.1045678.n5.nabble.com/file/n5735413/example_broken_surface.png" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/file/n5735413/example_broken_surface.png</a>><br>
<<a href="http://vtk.1045678.n5.nabble.com/file/n5735413/example_broken_surface_nonmanifold_edges.png" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/file/n5735413/example_broken_surface_nonmanifold_edges.png</a>><br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Broken-surfaces-for-vtkBooleanOperationPolyDataFilter-Bug-tp5735413.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/Broken-surfaces-for-vtkBooleanOperationPolyDataFilter-Bug-tp5735413.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<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/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_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=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/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>