diff --git a/c3cat-bottle-clip/c3cat-bottle-clip.scad b/c3cat-bottle-clip/c3cat-bottle-clip.scad index 19a51e7..4c5a6e2 100644 --- a/c3cat-bottle-clip/c3cat-bottle-clip.scad +++ b/c3cat-bottle-clip/c3cat-bottle-clip.scad @@ -61,7 +61,7 @@ USE_TINY_EARS = true; */ scale([0.2, 0.2, 0.2]) { difference() { - scale([5, 5, 5]) rotate(45, [0, 0, 1]) bottle_clip(name=NAME); + scale([5, 5, 5]) rotate(45, [0, 0, 1]) bottle_clip(name=NAME, logo=LOGO_FILE); translate([ 15*5, 0*5, 18*5]) rotate(80, [0, 1, 0]) catear(); translate([-15*5, 0*5, 18*5]) rotate(-80, [0, 1, 0]) catear(); } @@ -93,6 +93,7 @@ module name(name, font, rl, ht, ru) { module logo(logo, rl, ht, ru, width) { echo("logo: ", logo); if(logo == "") { + echo("CATEAR LOGO"); ear_size=ht; echo("ht: ", ht); echo("ru: ", ru); @@ -114,32 +115,29 @@ module logo(logo, rl, ht, ru, width) { with_rake=false ); } else { + echo("LOGO: ", logo); // The logo has been split in 3 parts. // well was... TODO -/* - rotate([0,0,-48]) translate([0,0,ht*3/4-0.1]) + rotate([0,0,-45]) translate([0,0,ht*3/4-0.1]) rotate([90,0,0]) - scale([0.9,0.9,1]) + scale([0.8,0.8,1]) scale([ht/100,ht/100,1]) - translate([-25,-29,0.5]) + translate([-32,-33,0.5]) linear_extrude(height=max(ru,rl)*2) - import("logo_1.dxf"); -*/ + import("test.svg"); translate([0,0,ht*3/4-0.1]) rotate([90,0,0]) scale([0.8,0.8,1]) scale([ht/100,ht/100,1]) - translate([-18,-22,0.5]) + translate([-32,-33,0.5]) linear_extrude(height=max(ru,rl)*2) import(logo); -/* - rotate([0,0,44]) translate([0,0,ht*3/4-0.1]) + rotate([0,0,45]) translate([0,0,ht*3/4-0.1]) rotate([90,0,0]) - scale([0.7,0.7,1]) + scale([0.8,0.8,1]) scale([ht/100,ht/100,1]) - translate([-25,-26,0.5]) + translate([-32,-33,0.5]) linear_extrude(height=max(ru,rl)*2) - import("logo_3.dxf"); -*/ + import("test.svg"); } } @@ -153,7 +151,7 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/o difference() { union() { name(name=name, font=font, rl=rl, ht=ht, ru=ru); - logo(logo=logo, rl=rl, ht=ht, ru=ru, width=width); + logo(logo=logo, rl=rl, ht=ht, ru=ru, width=2*width); } cylinder(r1=rl+width/2, r2=ru+width/2, h=ht); } diff --git a/c3cat-bottle-clip/sterntastatur.svg b/c3cat-bottle-clip/sterntastatur.svg new file mode 100644 index 0000000..520ed37 --- /dev/null +++ b/c3cat-bottle-clip/sterntastatur.svg @@ -0,0 +1,910 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/c3cat-bottle-clip/test.svg b/c3cat-bottle-clip/test.svg new file mode 100644 index 0000000..c983ded --- /dev/null +++ b/c3cat-bottle-clip/test.svg @@ -0,0 +1,46 @@ + + + + + + + + + + diff --git a/catear_headband.scad b/catear_headband.scad index 142ade5..a54398d 100644 --- a/catear_headband.scad +++ b/catear_headband.scad @@ -3,7 +3,7 @@ include ; use ; use ; -module catear(height, thickness, fractal=0, side_len=30, bend_factor=0.5, stretch_factor=1.2, debug=false, chamfer=CHAMFER, chamfer_shape=CHAMFER_SHAPE, details=true) { +module catear(height, thickness, fractal=0, side_len=30, bend_factor=0.5, stretch_factor=1.2, debug=false, chamfer=CHAMFER, chamfer_shape=CHAMFER_SHAPE, details=true, end_caps=true) { $A=[0, side_len/2]; $B=[0,-side_len/2]; $C=[-(side_len/2/sin(120))*1.5*stretch_factor, 0]; @@ -42,15 +42,17 @@ module catear(height, thickness, fractal=0, side_len=30, bend_factor=0.5, stretc thickness=thickness, height=height ); - translate($A) color("#aaaaaa") - chamfer(size=chamfer, child_h=height, child_bot=-height/2, shape=chamfer_shape) - cylinder(h=height, d=thickness, center=true); - translate($B) color("#bbbbbb") - chamfer(size=chamfer, child_h=height, child_bot=-height/2, shape=chamfer_shape) - cylinder(h=height, d=thickness, center=true); - translate($C) color("#cccccc") - chamfer(size=chamfer, child_h=height, child_bot=-height/2, shape=chamfer_shape) - cylinder(h=height, d=thickness, center=true); + if (end_caps) { + translate($A) color("#aaaaaa") + chamfer(size=chamfer, child_h=height, child_bot=-height/2, shape=chamfer_shape) + cylinder(h=height, d=thickness, center=true); + translate($B) color("#bbbbbb") + chamfer(size=chamfer, child_h=height, child_bot=-height/2, shape=chamfer_shape) + cylinder(h=height, d=thickness, center=true); + translate($C) color("#cccccc") + chamfer(size=chamfer, child_h=height, child_bot=-height/2, shape=chamfer_shape) + cylinder(h=height, d=thickness, center=true); + } if (debug) { echo("A", $A, "a", $a, "alpha", $alpha); diff --git a/generate_bottle_tag.sh b/generate_bottle_tag.sh index 8ea378d..877f7e8 100755 --- a/generate_bottle_tag.sh +++ b/generate_bottle_tag.sh @@ -11,6 +11,10 @@ FN=90 NAME="\"$1\"" +if [[ $# -ge 2 ]];then + LOGO_FILE="\"$2\"" +fi + # usage: render NAME PART render() { case "$2" in diff --git a/generate_lighthouse.sh b/generate_lighthouse.sh new file mode 100755 index 0000000..a09cded --- /dev/null +++ b/generate_lighthouse.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# usage: generate_bottle_tag.sh NAME + +set -u + +VERSION=0.1 +FN=360 + +# usage: render LAYER PART +render() { + case "$2" in + layer) + CONNECTOR=false + ;; + connector) + CONNECTOR=true + ;; + *) + echo 'fatal: invalid part' >&2 + exit 1 + ;; + esac + + echo rendering "$1" "$2" + openscad \ + -D "\$fn=${FN}" \ + -D "CONNECTOR=${CONNECTOR}" \ + -D "LAYER=$1" \ + -o "stls/lighthouse-${2}${1}-v${VERSION}.stl" \ + lighthouse.scad +} + +cd "$(dirname $0)" + +for LAYER in 1 2 3 4; +do + for PART in layer connector + do + render "$LAYER" "$PART" + sleep 1 + done +done diff --git a/lighthouse.scad b/lighthouse.scad new file mode 100644 index 0000000..df12e9c --- /dev/null +++ b/lighthouse.scad @@ -0,0 +1,72 @@ +$fn=360; + +LAYER = 1; +CONNECTOR = false; +BASE_LAYER_DIAMETER = 140; +LAYER_HEIGHT = 125; +LAYER_SHRINK = 10; +CONNECTOR_RING_GROOVE_DEPTH = 0.5; + +module layer(d) { + difference() { + cylinder(h=LAYER_HEIGHT, d1=d, d2=d-LAYER_SHRINK); + cylinder(h=LAYER_HEIGHT, d1=d-1, d2=d-LAYER_SHRINK-1); + } +} + +module layer_connector(d) { + difference() { + cylinder(h=3*CONNECTOR_RING_GROOVE_DEPTH, d=d+2, center=true); + cylinder(h=3*CONNECTOR_RING_GROOVE_DEPTH, d=d-3, center=true); + translate([0, 0, CONNECTOR_RING_GROOVE_DEPTH/2]) layer(d); + translate([0, 0, -125-CONNECTOR_RING_GROOVE_DEPTH/2]) layer(d+LAYER_SHRINK); + } +} + +module base(d) { + difference() { + union() { + difference() { + cylinder(h=LAYER_HEIGHT/10, d=d+3*LAYER_SHRINK); + translate([0, 0, LAYER_HEIGHT/10-CONNECTOR_RING_GROOVE_DEPTH]) + cylinder(h=LAYER_HEIGHT, d1=d, d2=d-LAYER_SHRINK);; + } + intersection() { + cylinder(h=LAYER_HEIGHT, d1=d-1, d2=d-LAYER_SHRINK-1); + cylinder(h=LAYER_HEIGHT/5, d=d+3*LAYER_SHRINK); + } + } + cylinder(h=LAYER_HEIGHT, d=d-LAYER_SHRINK, center=true); + translate([0, 0, 5]) rotate([90, 0, 0]) cylinder(h=d, d=10); + translate([0, -d/2, 0]) cube([10, d, 10], center=true); + } +} + +module brim(d) { + // TODO +} + +module lightroom(d) { + // TODO +} + +module light(d) { + // TODO +} + +module roof(d) { + // TODO +} + +D = BASE_LAYER_DIAMETER - (LAYER-1) * LAYER_SHRINK; + +if (CONNECTOR) { + if (LAYER == 1) base(D); + if ((LAYER >= 2) && (LAYER <= 4)) layer_connector(D); + if (LAYER == 5) brim(D); + if (LAYER == 6) roof(D); +} else { + if ((LAYER >=1) && (LAYER <=4)) layer(D); + if (LAYER == 5) lightroom(D); + if (LAYER == 6) light(D); +} diff --git a/pressfit_bunnyears.scad b/pressfit_bunnyears.scad new file mode 100644 index 0000000..7a34637 --- /dev/null +++ b/pressfit_bunnyears.scad @@ -0,0 +1,38 @@ +include ; + +use ; +use ; +use ; + +$fn=90; +EAR_SCALE = 0.5; +EAR_BEND_FACTOR = 0.2; +EAR_STRETCH_FACTOR = 8; +STEP_SIZE = .5; + +//difference() { + translate([20*pow(0.99, SIZE/2*EAR_SCALE-1-THICKNESS), 0, -THICKNESS/2]) + /*union()*/ for (i=[0:STEP_SIZE:SIZE/2*EAR_SCALE-1]) { + j=pow(0.99, i); + chamfer_ = floor(abs(2*i/(SIZE/2*EAR_SCALE-1)-1)); + translate([-j*20, 0, 0]) + rotate(90, [0, 1, 0]) + /*chamfer(size=1, child_h=1, child_bot=-0.5, shape=CHAMFER_SHAPE)*/ { + echo("i", i, "j", j, "chamfer_", chamfer_); + catear( + debug=DEBUG, + height=INSERTICLE_Z*1.2, + thickness=THICKNESS, + side_len=SIZE/2*EAR_SCALE-i, + bend_factor=EAR_BEND_FACTOR, + stretch_factor=EAR_STRETCH_FACTOR, + chamfer=0, //chamfer_, + chamfer_shape=CHAMFER_SHAPE, + details=false, + end_caps=false + ); + } + } +// translate([0, 0, -THICKNESS]) cube([100, 100, THICKNESS], center=true); +// scale([1, 1, 2]) inserticle(); +//} diff --git a/pressfit_catears.scad b/pressfit_catears.scad index 7697690..69b0e1d 100644 --- a/pressfit_catears.scad +++ b/pressfit_catears.scad @@ -7,26 +7,28 @@ use ; EAR_SCALE = 1.5; EAR_BEND_FACTOR = 0.15; EAR_STRETCH_FACTOR = 1.2; +STEP_SIZE = 1; difference() { -translate([20*pow(0.99, SIZE/2*EAR_SCALE-1-THICKNESS), 0, -THICKNESS/2]) -union() for (i=[0:SIZE/2*EAR_SCALE-1]) { - j=pow(0.99, i); - chamfer_ = floor(abs(2*i/(SIZE/2*EAR_SCALE-1)-1)); - translate([-j*20, 0, 0]) - rotate(90, [0, 1, 0]) - /*chamfer(size=1, child_h=1, child_bot=-0.5, shape=CHAMFER_SHAPE)*/ - catear( - debug=DEBUG, - height=INSERTICLE_Z*1.2, - thickness=THICKNESS, - side_len=SIZE/2*EAR_SCALE-i, - bend_factor=EAR_BEND_FACTOR, - stretch_factor=EAR_STRETCH_FACTOR, - chamfer=chamfer_, - chamfer_shape=CHAMFER_SHAPE - ); + translate([20*pow(0.99, SIZE/2*EAR_SCALE-1-THICKNESS), 0, -THICKNESS/2]) + union() for (i=[0:STEP_SIZE:SIZE/2*EAR_SCALE-1]) { + j=pow(0.99, i); + chamfer_ = floor(abs(2*i/(SIZE/2*EAR_SCALE-1)-1)); + translate([-j*20, 0, 0]) + rotate(90, [0, 1, 0]) + /*chamfer(size=1, child_h=1, child_bot=-0.5, shape=CHAMFER_SHAPE)*/ + catear( + debug=DEBUG, + height=INSERTICLE_Z*1.2, + thickness=THICKNESS, + side_len=SIZE/2*EAR_SCALE-i, + bend_factor=EAR_BEND_FACTOR, + stretch_factor=EAR_STRETCH_FACTOR, + chamfer=0, //chamfer_, + chamfer_shape=CHAMFER_SHAPE, + end_caps=false + ); + } + translate([0, 0, -THICKNESS]) cube([100, 100, THICKNESS], center=true); + scale([1, 1, 2]) inserticle(); } -translate([0, 0, -THICKNESS]) cube([100, 100, THICKNESS], center=true); -scale([1, 1, 2]) inserticle(); -} \ No newline at end of file