mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2024-11-22 08:20:50 +00:00
Fixed #59
Changed `enable_lip` to `style_lip` to allow a choice between a regular lip, removal of the lip (losing 3.6mm of height) or remove lip while retaining the regular height
This commit is contained in:
parent
e5576cc9a7
commit
e2e9ad536c
3 changed files with 12 additions and 10 deletions
|
@ -45,6 +45,8 @@ d_tabh = 15.85;
|
|||
d_tabw = 42;
|
||||
// angle of tab
|
||||
a_tab = 36;
|
||||
// lip height
|
||||
h_lip = 3.548;
|
||||
|
||||
d_wall2 = r_base-r_c1-d_clear*sqrt(2);
|
||||
d_magic = -2*d_clear-2*d_wall+d_div;
|
||||
|
|
|
@ -48,8 +48,8 @@ divy = 1;
|
|||
enable_scoop = true;
|
||||
// snap gridz height to nearest 7mm increment
|
||||
enable_zsnap = false;
|
||||
// enable upper lip for stacking other bins
|
||||
enable_lip = true;
|
||||
// how should the top lip act
|
||||
style_lip = 0; //[0: Regular lip, 1:remove lip subtractively, 2: remove lip and retain height]
|
||||
|
||||
/* [Other] */
|
||||
// determine what the variable "gridz" applies to based on your use case
|
||||
|
@ -72,7 +72,7 @@ div_base_y = 0;
|
|||
// ===== IMPLEMENTATION ===== //
|
||||
|
||||
color("tomato") {
|
||||
gridfinityInit(gridx, gridy, height(gridz, gridz_define, enable_lip, enable_zsnap), height_internal, length) {
|
||||
gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap), height_internal, length) {
|
||||
|
||||
if (divx > 0 && divy > 0)
|
||||
cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, enable_scoop = enable_scoop);
|
||||
|
|
|
@ -6,8 +6,8 @@ include <gridfinity-constants.scad>
|
|||
// ===== User Modules ===== //
|
||||
|
||||
// functions to convert gridz values to mm values
|
||||
function hf (z, d, l) = (d==0)?z*7:(d==1)?h_bot+z+h_base:z-(l?3.8:0);
|
||||
function height (z,d=0,l=true,s=true) = (s?((abs(hf(z,d,l))%7==0)?hf(z,d,l):hf(z,d,l)+7-abs(hf(z,d,l))%7):hf(z,d,l))-h_base;
|
||||
function hf (z, d, l) = ((d==0)?z*7:(d==1)?h_bot+z+h_base:z-((l==1)?h_lip:0))+(l==2?h_lip:0);
|
||||
function height (z,d=0,l=0,s=true) = (s?((abs(hf(z,d,l))%7==0)?hf(z,d,l):hf(z,d,l)+7-abs(hf(z,d,l))%7):hf(z,d,l))-h_base;
|
||||
|
||||
// Creates equally divided cutters for the bin
|
||||
//
|
||||
|
@ -36,7 +36,7 @@ module gridfinityInit(gx, gy, h, h0 = 0, l) {
|
|||
}
|
||||
color("royalblue")
|
||||
block_wall(gx, gy, l) {
|
||||
if (enable_lip) profile_wall();
|
||||
if (style_lip == 0) profile_wall();
|
||||
else profile_wall2();
|
||||
}
|
||||
}
|
||||
|
@ -225,10 +225,10 @@ module block_cutter(x,y,w,h,t,s) {
|
|||
v_ang_tab = a_tab;
|
||||
v_ang_lip = 45;
|
||||
|
||||
ycutfirst = y == 0 && enable_lip;
|
||||
ycutlast = abs(y+h-$gyy)<0.001 && enable_lip;
|
||||
xcutfirst = x == 0 && enable_lip;
|
||||
xcutlast = abs(x+w-$gxx)<0.001 && enable_lip;
|
||||
ycutfirst = y == 0 && style_lip == 0;
|
||||
ycutlast = abs(y+h-$gyy)<0.001 && style_lip == 0;
|
||||
xcutfirst = x == 0 && style_lip == 0;
|
||||
xcutlast = abs(x+w-$gxx)<0.001 && style_lip == 0;
|
||||
zsmall = ($dh+h_base)/7 < 3;
|
||||
|
||||
ylen = h*($gyy*length+d_magic)/$gyy-d_div;
|
||||
|
|
Loading…
Reference in a new issue