Bugfix/fix fixed baseplate offest (#143)

* make the baseplate xy offset configurable

* rename variable to be shorter

---------

Co-authored-by: Dirk Heilig <heilig@adesso-mobile.de>
This commit is contained in:
schorsch3000 2024-01-06 02:04:01 +01:00 committed by GitHub
parent c95938da94
commit 084f8ed981
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -72,13 +72,13 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh, fitx, fit
gx = gridx == 0 ? floor(dix/length) : gridx;
gy = gridy == 0 ? floor(diy/length) : gridy;
dx = max(gx*length-0.5, dix);
dy = max(gy*length-0.5, diy);
dx = max(gx*length-bp_xy_clearence, dix);
dy = max(gy*length-bp_xy_clearence, diy);
off = calculate_off(sp, sm, sh);
offsetx = dix < dx ? 0 : (gx*length-0.5-dix)/2*fitx*-1;
offsety = diy < dy ? 0 : (gy*length-0.5-diy)/2*fity*-1;
offsetx = dix < dx ? 0 : (gx*length-bp_xy_clearence-dix)/2*fitx*-1;
offsety = diy < dy ? 0 : (gy*length-bp_xy_clearence-diy)/2*fity*-1;
difference() {
translate([offsetx,offsety,h_base])

View file

@ -69,6 +69,8 @@ bp_rcut_width = 8.5;
bp_rcut_length = 4.25;
// Baseplate bottom cutout rounded thingy depth
bp_rcut_depth = 2;
// Baseplate clearence offset
bp_xy_clearence = 0.5;
// countersink diameter for baseplate
d_cs = 2.5;
// radius of cutout for skeletonized baseplate