Merge pull request #75 from Ruudjhuu/performance

improve performance
This commit is contained in:
Kenneth 2023-03-17 09:41:21 -07:00 committed by GitHub
commit f8f3baefb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 34 deletions

View file

@ -16,9 +16,9 @@ $fs = 0.25;
/* [General Settings] */
// number of bases along x-axis
gridx = 4;
gridx = 5;
// number of bases along y-axis
gridy = 4;
gridy = 5;
// base unit
length = 42;
@ -92,6 +92,9 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh, fitx, fit
rounded_rectangle(dx*2, dy*2, h_base*2, r_base);
pattern_linear(gx, gy, length) {
render() {
if (sm) block_base_hole(1);
if (sp == 1)
translate([0,0,-off])
cutter_weight();
@ -111,6 +114,7 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh, fitx, fit
else if (sh == 2) cutter_counterbore();
}
}
}
if (sp == 3 || sp ==4) cutter_screw_together(gx, gy, off);
}

View file

@ -29,9 +29,9 @@ $fs = 0.25;
/* [General Settings] */
// number of bases along x-axis
gridx = 1;
gridx = 5;
// number of bases along y-axis
gridy = 1;
gridy = 5;
// bin height. See bin height information and "gridz_define" below.
gridz = 6;
// base unit

View file

@ -97,9 +97,14 @@ module gridfinityBase(gx, gy, l, dx, dy, style_hole, off=0, final_cut=true) {
translate([0,0,-1])
rounded_rectangle(xx+0.005, yy+0.005, h_base+h_bot/2*10, r_fo1/2+0.001);
pattern_linear(gx/dbnx, gy/dbny, dbnx*l, dbny*l)
block_base(gx, gy, l, dbnx, dbny, style_hole, off);
}
}
module block_base(gx, gy, l, dbnx, dbny, style_hole, off) {
render()
difference() {
pattern_linear(gx/dbnx, gy/dbny, dbnx*l, dbny*l)
block_base_solid(dbnx, dbny, l, off);
if (style_hole > 0)
@ -107,12 +112,10 @@ module gridfinityBase(gx, gy, l, dx, dy, style_hole, off=0, final_cut=true) {
pattern_linear(2, 2, (gx-1)*length+d_hole, (gy-1)*length+d_hole)
block_base_hole(style_hole / p_corn, off);
else
pattern_linear(gx, gy, l)
pattern_circular(abs(d_hole)<0.001?1:4)
translate([d_hole/2, d_hole/2, 0])
block_base_hole(style_hole, off);
}
}
}
module block_base_solid(dbnx, dbny, l, o) {