mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2024-11-29 11:33:56 +00:00
use drawer dimensions for assertion
assertion previously used an uninitialized variable to assert either grid count or drawer size were specified. this change updates the assertion to use the drawer dimension parameters. now a baseplate can be created purely with draw dimensions and without grid counts
This commit is contained in:
parent
d1b6468d5a
commit
9b93f5945d
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue