mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2025-01-08 15:19:43 +00:00
only-edges proof of concept
This commit is contained in:
parent
7eb86296d9
commit
758e98dcc8
1 changed files with 12 additions and 1 deletions
|
@ -210,7 +210,7 @@ module profile_base() {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
module gridfinityBase(gx, gy, l, dx, dy, hole_options=bundle_hole_options(), off=0, final_cut=true, only_corners=false) {
|
module gridfinityBase(gx, gy, l, dx, dy, hole_options=bundle_hole_options(), off=0, final_cut=true, only_corners=false, only_edges=false) {
|
||||||
dbnxt = [for (i=[1:5]) if (abs(gx*i)%1 < 0.001 || abs(gx*i)%1 > 0.999) i];
|
dbnxt = [for (i=[1:5]) if (abs(gx*i)%1 < 0.001 || abs(gx*i)%1 > 0.999) i];
|
||||||
dbnyt = [for (i=[1:5]) if (abs(gy*i)%1 < 0.001 || abs(gy*i)%1 > 0.999) i];
|
dbnyt = [for (i=[1:5]) if (abs(gy*i)%1 < 0.001 || abs(gy*i)%1 > 0.999) i];
|
||||||
dbnx = 1/(dx==0 ? len(dbnxt) > 0 ? dbnxt[0] : 1 : round(dx));
|
dbnx = 1/(dx==0 ? len(dbnxt) > 0 ? dbnxt[0] : 1 : round(dx));
|
||||||
|
@ -244,6 +244,17 @@ module gridfinityBase(gx, gy, l, dx, dy, hole_options=bundle_hole_options(), off
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (only_edges) {
|
||||||
|
pattern_linear(gx/dbnx, gy/dbny, dbnx*l, dbny*l)
|
||||||
|
block_base(gx, gy, l, dbnx, dbny, hole_options, off);
|
||||||
|
|
||||||
|
intersection() {
|
||||||
|
pattern_linear(gx/dbnx, gy/dbny, dbnx*l, dbny*l)
|
||||||
|
block_base(gx, gy, l, dbnx, dbny, bundle_hole_options(), off);
|
||||||
|
|
||||||
|
# cube([(gx-1)*l, (gy-1)*l, 14], center=true);
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
pattern_linear(gx/dbnx, gy/dbny, dbnx*l, dbny*l)
|
pattern_linear(gx/dbnx, gy/dbny, dbnx*l, dbny*l)
|
||||||
block_base(gx, gy, l, dbnx, dbny, hole_options, off);
|
block_base(gx, gy, l, dbnx, dbny, hole_options, off);
|
||||||
|
|
Loading…
Reference in a new issue