Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/srf/boolean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,28 +193,24 @@ void SSurface::TrimFromEdgeList(SEdgeList *el, bool asUv) {
static bool KeepRegion(SSurface::CombineAs type, bool opA, SShell::Class shell, SShell::Class orig)
{
bool inShell = (shell == SShell::Class::INSIDE),
outSide = (shell == SShell::Class::OUTSIDE),
inSame = (shell == SShell::Class::COINC_SAME),
inOpp = (shell == SShell::Class::COINC_OPP),
inOrig = (orig == SShell::Class::INSIDE);

bool inFace = inSame || inOpp;

// If these are correct, then they should be independent of inShell
// if inFace is true.
if(!inOrig) return false;
switch(type) {
case SSurface::CombineAs::UNION:
if(opA) {
return (!inShell && !inFace);
return outSide;
} else {
return (!inShell && !inFace) || inSame;
return outSide || inSame;
}

case SSurface::CombineAs::DIFFERENCE:
if(opA) {
return (!inShell && !inFace);
return outSide;
} else {
return (inShell && !inFace) || inSame;
return inShell || inSame;
}

default: ssassert(false, "Unexpected combine type");
Expand Down