mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-07 12:49:46 +00:00
Merge pull request #242 from kelvie/diff-tag-fix
Fix diff/intersect when some tags are hidden
This commit is contained in:
commit
248921df8d
1 changed files with 22 additions and 16 deletions
|
@ -1235,17 +1235,20 @@ module show(tags="")
|
||||||
// }
|
// }
|
||||||
module diff(neg, pos=undef, keep=undef)
|
module diff(neg, pos=undef, keep=undef)
|
||||||
{
|
{
|
||||||
difference() {
|
// Don't perform the operation if the current tags are hidden
|
||||||
if (pos != undef) {
|
if (attachment_is_shown($tags)) {
|
||||||
show(pos) children();
|
difference() {
|
||||||
} else {
|
if (pos != undef) {
|
||||||
if (keep == undef) {
|
show(pos) children();
|
||||||
hide(neg) children();
|
|
||||||
} else {
|
} else {
|
||||||
hide(str(neg," ",keep)) children();
|
if (keep == undef) {
|
||||||
|
hide(neg) children();
|
||||||
|
} else {
|
||||||
|
hide(str(neg," ",keep)) children();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
show(neg) children();
|
||||||
}
|
}
|
||||||
show(neg) children();
|
|
||||||
}
|
}
|
||||||
if (keep!=undef) {
|
if (keep!=undef) {
|
||||||
show(keep) children();
|
show(keep) children();
|
||||||
|
@ -1280,17 +1283,20 @@ module diff(neg, pos=undef, keep=undef)
|
||||||
// }
|
// }
|
||||||
module intersect(a, b=undef, keep=undef)
|
module intersect(a, b=undef, keep=undef)
|
||||||
{
|
{
|
||||||
intersection() {
|
// Don't perform the operation if the current tags are hidden
|
||||||
if (b != undef) {
|
if (attachment_is_shown($tags)) {
|
||||||
show(b) children();
|
intersection() {
|
||||||
} else {
|
if (b != undef) {
|
||||||
if (keep == undef) {
|
show(b) children();
|
||||||
hide(a) children();
|
|
||||||
} else {
|
} else {
|
||||||
hide(str(a," ",keep)) children();
|
if (keep == undef) {
|
||||||
|
hide(a) children();
|
||||||
|
} else {
|
||||||
|
hide(str(a," ",keep)) children();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
show(a) children();
|
||||||
}
|
}
|
||||||
show(a) children();
|
|
||||||
}
|
}
|
||||||
if (keep!=undef) {
|
if (keep!=undef) {
|
||||||
show(keep) children();
|
show(keep) children();
|
||||||
|
|
Loading…
Reference in a new issue