Fix only_corners not working correctly

This commit is contained in:
Arthur Moore 2024-08-29 00:51:21 -04:00
parent 563c94768c
commit b8e14c1264
2 changed files with 9 additions and 1 deletions

View file

@ -230,7 +230,7 @@ module gridfinityBase(gx, gy, l, dx, dy, hole_options=bundle_hole_options(), off
if(only_corners) {
difference(){
pattern_linear(gx/dbnx, gy/dbny, dbnx*l, dbny*l)
block_base(gx, gy, l, dbnx, dbny, 0, off);
block_base(gx, gy, l, dbnx, dbny, bundle_hole_options(), off);
copy_mirror([0, 1, 0]) {
copy_mirror([1, 0, 0]) {

View file

@ -37,6 +37,14 @@ class TestBinHoles(unittest.TestCase):
vars["screw_holes"] = False
self.scad_runner.create_image([], Path('no_holes.png'))
def test_only_corner_holes(self):
vars = self.scad_runner.parameters
vars["refined_holes"] = True
vars["magnet_holes"] = False
vars["screw_holes"] = False
vars["only_corners"] = True
self.scad_runner.create_image([], Path('only_corner_holes.png'))
def test_refined_holes(self):
vars = self.scad_runner.parameters
vars["refined_holes"] = True