mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2024-12-22 23:03:28 +00:00
Fixed 0.5mm gap between grids.
This fixes a compatibility issue when using fractional grid sizes.
This commit is contained in:
parent
728fff110a
commit
1b70c40186
1 changed files with 11 additions and 8 deletions
|
@ -224,18 +224,21 @@ module gridfinityBase(gx, gy, length, dx, dy, hole_options=bundle_hole_options()
|
||||||
// Final size in number of bases
|
// Final size in number of bases
|
||||||
grid_size = [gx/dbnx, gy/dbny];
|
grid_size = [gx/dbnx, gy/dbny];
|
||||||
|
|
||||||
// Per spec, there's a 0.5mm gap between each base,
|
// Per spec, there's a 0.5mm gap between each base.
|
||||||
// But that needs to be scaled based on everything else.
|
// This must be kept constant or half bins may not work correctly.
|
||||||
individual_base_size_mm = [dbnx, dbny] * BASE_SIZE;
|
gap_mm = l_grid - BASE_SIZE;
|
||||||
base_center_distance_mm = [dbnx, dbny] * length;
|
|
||||||
gap_mm = base_center_distance_mm - individual_base_size_mm;
|
base_center_distance_mm = [dbnx, dbny] * length; // Per spec this should be 42.
|
||||||
|
individual_base_size_mm = [base_center_distance_mm.x - gap_mm, base_center_distance_mm.y - gap_mm];
|
||||||
|
|
||||||
// Final size of the base top. In mm.
|
// Final size of the base top. In mm.
|
||||||
|
// subtracting gap_mm here to remove an outer lip along the peremiter.
|
||||||
grid_size_mm = [
|
grid_size_mm = [
|
||||||
base_center_distance_mm.x * grid_size.x,
|
base_center_distance_mm.x * grid_size.x - gap_mm,
|
||||||
base_center_distance_mm.y * grid_size.y,
|
base_center_distance_mm.y * grid_size.y - gap_mm
|
||||||
] - gap_mm;
|
];
|
||||||
|
|
||||||
|
// Top which ties all bases together
|
||||||
if (final_cut) {
|
if (final_cut) {
|
||||||
translate([0, 0, h_base-TOLLERANCE])
|
translate([0, 0, h_base-TOLLERANCE])
|
||||||
rounded_square([grid_size_mm.x, grid_size_mm.y, h_bot], BASE_OUTSIDE_RADIUS, center=true);
|
rounded_square([grid_size_mm.x, grid_size_mm.y, h_bot], BASE_OUTSIDE_RADIUS, center=true);
|
||||||
|
|
Loading…
Reference in a new issue