From 1b1904b8ee8c01db211100856d82278550b11dc5 Mon Sep 17 00:00:00 2001 From: Danilo Sanchi Date: Thu, 7 Nov 2024 18:20:23 +0100 Subject: [PATCH 1/2] cleanup floor difference overhangs --- gridfinity_cup_modules.scad | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gridfinity_cup_modules.scad b/gridfinity_cup_modules.scad index acfcb42..c06a974 100644 --- a/gridfinity_cup_modules.scad +++ b/gridfinity_cup_modules.scad @@ -75,7 +75,7 @@ module basic_cup( difference() { grid_block(num_x, num_y, num_z, magnet_diameter, screw_depth, hole_overhang_remedy=hole_overhang_remedy, half_pitch=half_pitch, box_corner_attachments_only=box_corner_attachments_only); color("red") partitioned_cavity(num_x, num_y, num_z, withLabel=withLabel, - labelWidth=labelWidth, fingerslide=fingerslide, magnet_diameter=magnet_diameter, + labelWidth=labelWidth, fingerslide=fingerslide, magnet_diameter=magnet_diameter, screw_depth=screw_depth, floor_thickness=floor_thickness, wall_thickness=wall_thickness, efficient_floor=efficient_floor, separator_positions=separator_positions, lip_style=lip_style); } @@ -289,6 +289,12 @@ module basic_cavity(num_x, num_y, num_z, fingerslide=default_fingerslide, tz(3) cornercopy(seventeen-0.5) cylinder(r=1, h=1, $fn=32); tz(5-(+2.5-1.15-q)) cornercopy(seventeen) cylinder(r=1.15+q, h=4, $fn=32); } + + // cleanup floor difference overhangs + hull() + cornercopy(seventeen, num_x, num_y) { + tz(floorht) cylinder(d=2.3+2*q, h=2.3+2*q, $fn=24); + } } } } From 18a6099ced6c2af8a150ea7c2e28fc41e1f3cc5b Mon Sep 17 00:00:00 2001 From: Danilo Sanchi Date: Thu, 7 Nov 2024 01:19:27 +0100 Subject: [PATCH 2/2] fix half_pitch+efloor --- gridfinity_cup_modules.scad | 45 ++++++++++++++++++++++++------------- gridfinity_modules.scad | 10 ++++++--- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/gridfinity_cup_modules.scad b/gridfinity_cup_modules.scad index c06a974..449dfd2 100644 --- a/gridfinity_cup_modules.scad +++ b/gridfinity_cup_modules.scad @@ -77,7 +77,7 @@ module basic_cup( color("red") partitioned_cavity(num_x, num_y, num_z, withLabel=withLabel, labelWidth=labelWidth, fingerslide=fingerslide, magnet_diameter=magnet_diameter, screw_depth=screw_depth, floor_thickness=floor_thickness, wall_thickness=wall_thickness, - efficient_floor=efficient_floor, separator_positions=separator_positions, lip_style=lip_style); + efficient_floor=efficient_floor, separator_positions=separator_positions, lip_style=lip_style, half_pitch=half_pitch); } } @@ -114,7 +114,8 @@ module partitioned_cavity(num_x, num_y, num_z, withLabel=default_withLabel, labelWidth=default_labelWidth, fingerslide=default_fingerslide, magnet_diameter=default_magnet_diameter, screw_depth=default_screw_depth, floor_thickness=default_floor_thickness, wall_thickness=default_wall_thickness, - efficient_floor=default_efficient_floor, separator_positions=[], lip_style=default_lip_style) { + efficient_floor=default_efficient_floor, separator_positions=[], lip_style=default_lip_style, + half_pitch=default_half_pitch) { // cavity with removed segments so that we leave dividing walls behind gp = gridfinity_pitch; outer_wall_th = 1.8; // cavity is this far away from the 42mm 'ideal' block @@ -133,7 +134,7 @@ module partitioned_cavity(num_x, num_y, num_z, withLabel=default_withLabel, difference() { basic_cavity(num_x, num_y, num_z, fingerslide=fingerslide, magnet_diameter=magnet_diameter, screw_depth=screw_depth, floor_thickness=floor_thickness, wall_thickness=wall_thickness, - efficient_floor=efficient_floor, lip_style=lip_style); + efficient_floor=efficient_floor, lip_style=lip_style, half_pitch=half_pitch); if (len(separator_positions) > 0) { for (i=[0:len(separator_positions)-1]) { @@ -156,8 +157,8 @@ module partitioned_cavity(num_x, num_y, num_z, withLabel=default_withLabel, chamberStart = i == 0 ? 0 : separator_positions[i-1]; chamberWidth = chamberWidths[i]; label_num_x = (labelWidth == 0 || labelWidth > chamberWidth) ? chamberWidth : labelWidth; - label_pos_x = (withLabel == "center" || withLabel == "centerchamber" )? (chamberWidth - label_num_x) / 2 - : (withLabel == "right" || withLabel == "rightchamber" )? chamberWidth - label_num_x + label_pos_x = (withLabel == "center" || withLabel == "centerchamber" )? (chamberWidth - label_num_x) / 2 + : (withLabel == "right" || withLabel == "rightchamber" )? chamberWidth - label_num_x : 0 ; hull() for (i=[0,1, 2]) @@ -177,7 +178,8 @@ module partitioned_cavity(num_x, num_y, num_z, withLabel=default_withLabel, module basic_cavity(num_x, num_y, num_z, fingerslide=default_fingerslide, magnet_diameter=default_magnet_diameter, screw_depth=default_screw_depth, floor_thickness=default_floor_thickness, wall_thickness=default_wall_thickness, - efficient_floor=default_efficient_floor, lip_style=default_lip_style) { + efficient_floor=default_efficient_floor, lip_style=default_lip_style, + half_pitch=default_half_pitch) { eps = 0.1; // I couldn't think of a good name for this ('q') but effectively it's the // size of the overhang that produces a wall thickness that's less than the lip @@ -239,14 +241,14 @@ module basic_cavity(num_x, num_y, num_z, fingerslide=default_fingerslide, // reduced slide position is -seventeen-1.85 which is the edge of the upper lip // no lip means we need -gridfinity_pitch/2+1.5+0.25+wall_thickness ? translate([0, ( - lip_style3 == "reduced" ? -0.7 + lip_style3 == "reduced" ? -0.7 : (lip_style3=="none" ? seventeen+1.15-gridfinity_pitch/2+0.25+wall_thickness : 0 ) ), 0]) translate([0, pivot_y, pivot_z]) rotate([90*ai/(facets-1), 0, 0]) translate([0, -pivot_y, -pivot_z]) - translate([-gridfinity_pitch/2, -10-seventeen-1.15, 0]) + translate([-gridfinity_pitch/2, -10-seventeen-1.15, 0]) cube([gridfinity_pitch*num_x, 10, gridfinity_zpitch*num_z+5]); } } @@ -281,13 +283,26 @@ module basic_cavity(num_x, num_y, num_z, fingerslide=default_fingerslide, } } else { - // establishes floor - gridcopy(num_x, num_y) hull() tz(floor_thickness) cornercopy(seventeen-0.5) cylinder(r=1, h=5, $fn=32); - - // tapered top portion - gridcopy(num_x, num_y) hull() { - tz(3) cornercopy(seventeen-0.5) cylinder(r=1, h=1, $fn=32); - tz(5-(+2.5-1.15-q)) cornercopy(seventeen) cylinder(r=1.15+q, h=4, $fn=32); + if (half_pitch) { + // establishes floor + gridcopy(num_x, num_y, half_pitch=half_pitch) hull() { + tz(floor_thickness) cornercopy(seventeen-0.5-gridfinity_pitch/4) cylinder(r=1, h=5, $fn=32); + } + + // tapered top portion + gridcopy(num_x, num_y, half_pitch=half_pitch) hull() { + tz(3) cornercopy(seventeen-0.5-gridfinity_pitch/4) cylinder(r=1, h=1, $fn=32); + tz(5-(+2.5-1.15-q)) cornercopy(seventeen-gridfinity_pitch/4) cylinder(r=1.15+q, h=4, $fn=32); + } + } else { + // establishes floor + gridcopy(num_x, num_y) hull() tz(floor_thickness) cornercopy(seventeen-0.5) cylinder(r=1, h=5, $fn=32); + + // tapered top portion + gridcopy(num_x, num_y) hull() { + tz(3) cornercopy(seventeen-0.5) cylinder(r=1, h=1, $fn=32); + tz(5-(+2.5-1.15-q)) cornercopy(seventeen) cylinder(r=1.15+q, h=4, $fn=32); + } } // cleanup floor difference overhangs diff --git a/gridfinity_modules.scad b/gridfinity_modules.scad index 69702ee..0b7bd12 100644 --- a/gridfinity_modules.scad +++ b/gridfinity_modules.scad @@ -195,14 +195,18 @@ module gridcopycorners(num_x, num_y, r, onlyBoxCorners = false) { // similar to quadtranslate but expands to extremities of a block module cornercopy(r, num_x=1, num_y=1) { - for (xx=[-r, gridfinity_pitch*(num_x-1)+r]) for (yy=[-r, gridfinity_pitch*(num_y-1)+r]) + for (xx=[-r, gridfinity_pitch*(num_x-1)+r]) for (yy=[-r, gridfinity_pitch*(num_y-1)+r]) translate([xx, yy, 0]) children(); } // make repeated copies of something(s) at the gridfinity spacing of 42mm -module gridcopy(num_x, num_y) { - for (xi=[1:num_x]) for (yi=[1:num_y]) translate([gridfinity_pitch*(xi-1), gridfinity_pitch*(yi-1), 0]) children(); +module gridcopy(num_x, num_y, half_pitch=default_half_pitch) { + if (half_pitch) { + for (xi=[1:num_x*2]) for (yi=[1:num_y*2]) translate([gridfinity_pitch/2*(xi-1.5), gridfinity_pitch/2*(yi-1.5), 0]) children(); + } else { + for (xi=[1:num_x]) for (yi=[1:num_y]) translate([gridfinity_pitch*(xi-1), gridfinity_pitch*(yi-1), 0]) children(); + } }