chiark
/
gitweb
/
~ianmdlvl
/
reprap-play.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
881a2ab
)
knifeblock: Have HexGrid calculate jmin et al from coordinates (no ultimate resulting...
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 2 Jan 2015 00:33:45 +0000
(
00:33
+0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 2 Jan 2015 00:33:45 +0000
(
00:33
+0000)
knifeblock.scad
patch
|
blob
|
history
diff --git
a/knifeblock.scad
b/knifeblock.scad
index 4261be685bf146a34a4dc79c8bb066c8d6d39849..fcf3e4bdf2167108752228f03763068412828c1b 100644
(file)
--- a/
knifeblock.scad
+++ b/
knifeblock.scad
@@
-147,7
+147,7
@@
module BlockPegSlot(){
module DecorativeIndents(){
translate([0, -front, 0])
rotate([90,0,0])
module DecorativeIndents(){
translate([0, -front, 0])
rotate([90,0,0])
- HexGrid(-
5,5,-5,5
) {
+ HexGrid(-
height, 0, minx,maxx
) {
hull(){
translate([0, 0, -indentdepth])
cylinder(r=indentinnersize/2, h=indentdepth, $fn=40);
hull(){
translate([0, 0, -indentdepth])
cylinder(r=indentinnersize/2, h=indentdepth, $fn=40);
@@
-241,7
+241,12
@@
module HolesScope(){
}
}
}
}
-module HexGrid(imin,imax,jmin,jmax) {
+module HexGrid(xa,xb,ya,yb) {
+ imin = floor(xa / holepitch);
+ imax = ceil(xb / holepitch);
+ jmin = floor(ya / (sqrt(3)*holepitch));
+ jmax = ceil(yb / (sqrt(3)*holepitch));
+ echo("HexGrid ",imin,imax,jmin,jmax);
for (i=[imin:imax]) {
for (j=[jmin:jmax]) {
translate([(j * sqrt(3) + holeoffx) * holepitch,
for (i=[imin:imax]) {
for (j=[jmin:jmax]) {
translate([(j * sqrt(3) + holeoffx) * holepitch,
@@
-260,13
+265,9
@@
module Hole(){
}
module Holes(){
}
module Holes(){
- imax = ceil(coverlonglen / holepitch);
- echo("Holes Y count ", imax);
- jmin = ceil((maxx-minx)/(sqrt(3)*holepitch));
- echo("Holes X count 2 x", jmin);
intersection(){
translate([0, 0, -20])
intersection(){
translate([0, 0, -20])
- HexGrid(0,
imax,-jmin,2
)
+ HexGrid(0,
coverlonglen, minx, maxx
)
Hole();
HolesScope();
}
Hole();
HolesScope();
}