mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2024-12-22 06:43:25 +00:00
Merge pull request #223 from therealzanfar/feature/tab-placement
Add feature to suppress tabs from certain divisions
This commit is contained in:
commit
b4ff7063cc
2 changed files with 15 additions and 3 deletions
|
@ -73,6 +73,8 @@ enable_zsnap = false;
|
||||||
/* [Features] */
|
/* [Features] */
|
||||||
// the type of tabs
|
// the type of tabs
|
||||||
style_tab = 1; //[0:Full,1:Auto,2:Left,3:Center,4:Right,5:None]
|
style_tab = 1; //[0:Full,1:Auto,2:Left,3:Center,4:Right,5:None]
|
||||||
|
// which divisions have tabs
|
||||||
|
place_tab = 0; // [0:Everywhere-Normal,1:Top-Left Division]
|
||||||
// how should the top lip act
|
// how should the top lip act
|
||||||
style_lip = 0; //[0: Regular lip, 1:remove lip subtractively, 2: remove lip and retain height]
|
style_lip = 0; //[0: Regular lip, 1:remove lip subtractively, 2: remove lip and retain height]
|
||||||
// scoop weight percentage. 0 disables scoop, 1 is regular scoop. Any real number will scale the scoop.
|
// scoop weight percentage. 0 disables scoop, 1 is regular scoop. Any real number will scale the scoop.
|
||||||
|
@ -111,7 +113,7 @@ gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap
|
||||||
|
|
||||||
if (divx > 0 && divy > 0) {
|
if (divx > 0 && divy > 0) {
|
||||||
|
|
||||||
cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, scoop_weight = scoop);
|
cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, scoop_weight = scoop, place_tab = place_tab);
|
||||||
|
|
||||||
} else if (cdivx > 0 && cdivy > 0) {
|
} else if (cdivx > 0 && cdivy > 0) {
|
||||||
|
|
||||||
|
|
|
@ -72,10 +72,20 @@ function height (z,d=0,l=0,enable_zsnap=true) =
|
||||||
// set n_div values to 0 for a solid bin
|
// set n_div values to 0 for a solid bin
|
||||||
// style_tab: tab style for all compartments. see cut()
|
// style_tab: tab style for all compartments. see cut()
|
||||||
// scoop_weight: scoop toggle for all compartments. see cut()
|
// scoop_weight: scoop toggle for all compartments. see cut()
|
||||||
module cutEqual(n_divx=1, n_divy=1, style_tab=1, scoop_weight=1) {
|
// place_tab: tab suppression for all compartments. see "gridfinity-rebuilt-bins.scad"
|
||||||
|
module cutEqual(n_divx=1, n_divy=1, style_tab=1, scoop_weight=1, place_tab=1) {
|
||||||
for (i = [1:n_divx])
|
for (i = [1:n_divx])
|
||||||
for (j = [1:n_divy])
|
for (j = [1:n_divy])
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
place_tab == 1 && (i != 1 || j != n_divy) // Top-Left Division
|
||||||
|
) {
|
||||||
|
cut((i-1)*$gxx/n_divx,(j-1)*$gyy/n_divy, $gxx/n_divx, $gyy/n_divy, 5, scoop_weight);
|
||||||
|
}
|
||||||
|
else {
|
||||||
cut((i-1)*$gxx/n_divx,(j-1)*$gyy/n_divy, $gxx/n_divx, $gyy/n_divy, style_tab, scoop_weight);
|
cut((i-1)*$gxx/n_divx,(j-1)*$gyy/n_divy, $gxx/n_divx, $gyy/n_divy, style_tab, scoop_weight);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue