Merge pull request #38 from eddiesoller/use-drawer-dimensions-for-assertion

use drawer dimensions for assertion
This commit is contained in:
Kenneth 2022-12-29 21:43:37 -07:00 committed by GitHub
commit c06aee5778
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,8 +51,8 @@ gridfinityBaseplate(gridx, gridy, length, distancex, distancey, style_plate, ena
module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh) { module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh) {
assert(gridx > 0 || dx > 0, "Must have positive x grid amount!"); assert(gridx > 0 || dix > 0, "Must have positive x grid amount!");
assert(gridy > 0 || dy > 0, "Must have positive y grid amount!"); assert(gridy > 0 || diy > 0, "Must have positive y grid amount!");
gx = gridx == 0 ? floor(dix/length) : gridx; gx = gridx == 0 ? floor(dix/length) : gridx;
gy = gridy == 0 ? floor(diy/length) : gridy; gy = gridy == 0 ? floor(diy/length) : gridy;
dx = max(gx*length-0.5, dix); dx = max(gx*length-0.5, dix);