From cc88b7e441eeb5a768543bc4694285608bd8d8d1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 31 Dec 2014 17:51:17 +0000 Subject: [PATCH] knifeblock: move PegTemplate and AtSides up (nfc) --- knifeblock.scad | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/knifeblock.scad b/knifeblock.scad index 64b8468..e708c64 100644 --- a/knifeblock.scad +++ b/knifeblock.scad @@ -102,6 +102,22 @@ module ScrewHole(){ cylinder(r=screwcsinkdia/2 / (sqrt(3)/2), h=100, $fn=6); } +module PegTemplate(){ + for (mx=[0,1]) for (my=[0,1]) { + mirror([mx,0,0]) mirror([0,my,0]) + polygon([[-0.1, -0.1], + [pegstem/2, -0.1], + [pegstem/2, pegstemheight/2], + [peghead/2, pegheight /2], + [-0.1, pegheight /2]]); + } +} + +module AtSides(){ + translate([minx,0,0]) child(0); + translate([maxx,0,0]) mirror([1,0,0]) child(1); +} + module Block(){ sidemidx = minsideout + screwcsinkdia/2; @@ -153,17 +169,6 @@ module CoverSide(len){ } } -module PegTemplate(){ - for (mx=[0,1]) for (my=[0,1]) { - mirror([mx,0,0]) mirror([0,my,0]) - polygon([[-0.1, -0.1], - [pegstem/2, -0.1], - [pegstem/2, pegstemheight/2], - [peghead/2, pegheight /2], - [-0.1, pegheight /2]]); - } -} - module Peg(){ echo("peg angle slope (must be <1)", (peghead-pegstem)/(pegheight-pegstemheight)); @@ -189,11 +194,6 @@ module CoverPegSlot(coverlen){ } } -module AtSides(){ - translate([minx,0,0]) child(0); - translate([maxx,0,0]) mirror([1,0,0]) child(1); -} - module Cover(){ difference(){ union(){ @@ -218,3 +218,4 @@ module Demo(){ ////toplevel Demo(); //Cover(); +//Peg(); -- 2.30.2