PerkLab / SlicerSandbox

Collection of utilities that are not polished implementations but can be useful to users
BSD 2-Clause "Simplified" License
67 stars 24 forks source link

Add CombineModels function RobustBooleanOperation #16

Open mauigna06 opened 1 year ago

mauigna06 commented 1 year ago

RobustBooleanOperation will transform one of the inputs with a small pose variation to get the boolean operation to succeed

The syntax should be:

RobustBooleanOperation(
    inputMesh1,
    inputMesh2,
    resultingMesh,
    mmTranslationDelta=1e-4,
    degRotationDelta=1e-2,
    transformTries=15,
    randomSeed=None
)

Feedback is welcomed I think I could develop this on the near future so you could assign it to me

Thank you

mauigna06 commented 3 months ago

@lassoan, I'm willing to implement this logic (and it's GUI) for CombineModels' RobustBooleanOperations because vtkbool sometimes "randomly" fails:

New definition of "process" function would be like code below.

def process(
    inputMesh1,
    inputMesh2,
    resultingMesh,
    booleanOperationType,
    mmTranslationDelta=1e-4,
    degRotationDelta=0.0,
    transformTries=15,
    randomSeed=None
)

Let me know if you'd be willing to merge this change

lassoan commented 2 months ago

Do you have an example data set to reproduce this issue? Author of vtkbool was quite responsive in fixing issues. Have you reported the issue to him already?

I would much prefer getting the root cause fixed than hide it by some trick, especially because the trick would slow down execution and may cause other issues.

mauigna06 commented 2 months ago

Hi Andras,

Do you have an example data set to reproduce this issue? Author of vtkbool was quite responsive in fixing issues. Have you reported the issue to him already?

Yes, please here see https://github.com/zippy84/vtkbool/issues/80