Convert to library; add Makefile, images
hexbrick-preview.png is a generated file, but for technical reasons it must be committed to git to be shown on the github website.
This commit is contained in:
parent
48b9537b65
commit
1369d1d9a5
6 changed files with 60 additions and 28 deletions
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
hexbrick-demo.scad
|
||||
*.stl
|
||||
*.png
|
||||
!hexbrick-preview.png
|
||||
24
Makefile
Normal file
24
Makefile
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
default: hexbrick-demo.scad hexbrick-demo.stl hexbrick-demo.png hexbrick-preview.png
|
||||
|
||||
hexbrick-demo.scad: hexbrick-lib.scad demo.scad
|
||||
cat $^ > $@
|
||||
|
||||
%.stl: %.scad
|
||||
openscad -o $@ $^
|
||||
|
||||
XVFB_RUN := xvfb-run -s "-screen 0 1024x768x24"
|
||||
|
||||
%.png: %.scad
|
||||
$(XVFB_RUN) openscad --camera=15,20,0,30,0,25,120 --autocenter --imgsize 7680,5120 -o $*_4x.png $^
|
||||
convert -geometry 25% $*_4x.png $@
|
||||
rm -f $*_4x.png
|
||||
|
||||
hexbrick-preview.png: hexbrick-demo.png
|
||||
convert -geometry 50% $< $@
|
||||
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f hexbrick-demo.scad hexbrick-demo.stl hexbrick-demo.png
|
||||
|
||||
.DELETE_ON_ERROR:
|
||||
3
README.md
Normal file
3
README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Interlocking Hexagonal Toy Bricks
|
||||
|
||||

|
||||
29
demo.scad
Normal file
29
demo.scad
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
// A-1
|
||||
hexgrid(-1,3)
|
||||
piece_coordlist([[[0,0]]]);
|
||||
piece_coordlist([
|
||||
[[0,1]], [[2,0]]
|
||||
]);
|
||||
|
||||
// A-3.1
|
||||
hexgrid(1,3)
|
||||
piece_coordlist([
|
||||
[[0,2]], [[2,1]], [[4,0]]
|
||||
]);
|
||||
// A-3.2
|
||||
hexgrid(4,0)
|
||||
piece_coordlist([
|
||||
[[0,2]], [[2,1]], [[3,2]]
|
||||
]);
|
||||
|
||||
// A-3.3
|
||||
hexgrid(1,1)
|
||||
piece_coordlist([
|
||||
[[0,1]], [[2,0]], [[1,2]]
|
||||
]);
|
||||
|
||||
// D-1 (lateral brick)
|
||||
hexgrid(4,-1)
|
||||
piece_coordlist([[[0,0],[2,0]]]);
|
||||
|
||||
|
|
@ -171,31 +171,3 @@ module piece_coordlist(cc) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A-1
|
||||
hexgrid(-1,3)
|
||||
piece_coordlist([[[0,0]]]);
|
||||
piece_coordlist([
|
||||
[[0,1]], [[2,0]]
|
||||
]);
|
||||
|
||||
// A-3.1
|
||||
hexgrid(1,3)
|
||||
piece_coordlist([
|
||||
[[0,2]], [[2,1]], [[4,0]]
|
||||
]);
|
||||
// A-3.2
|
||||
hexgrid(4,0)
|
||||
piece_coordlist([
|
||||
[[0,2]], [[2,1]], [[3,2]]
|
||||
]);
|
||||
|
||||
// A-3.3
|
||||
hexgrid(1,1)
|
||||
piece_coordlist([
|
||||
[[0,1]], [[2,0]], [[1,2]]
|
||||
]);
|
||||
|
||||
// D-1 (lateral brick)
|
||||
hexgrid(4,-1)
|
||||
piece_coordlist([[[0,0],[2,0]]]);
|
||||
BIN
hexbrick-preview.png
Normal file
BIN
hexbrick-preview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 134 KiB |
Loading…
Reference in a new issue