c3cat_bottle_tag v2.0
This commit is contained in:
parent
9113567ab2
commit
69e8b09fa7
4 changed files with 98 additions and 32 deletions
|
@ -26,6 +26,16 @@
|
|||
*/
|
||||
|
||||
include <write/Write.scad>
|
||||
use <catear_headband.scad>
|
||||
|
||||
$fn = 360;
|
||||
|
||||
NAME = "c3cat";
|
||||
LOGO_FILE = ""; // empty string is catear model
|
||||
RENDER_COLOR_ONE = true;
|
||||
RENDER_COLOR_TWO = true;
|
||||
RENDER_COLOR_THREE = true;
|
||||
USE_TINY_EARS = true;
|
||||
|
||||
/**
|
||||
* Creates one instance of a bottle clip name tag. The default values are
|
||||
|
@ -51,7 +61,7 @@ include <write/Write.scad>
|
|||
*/
|
||||
scale([0.2, 0.2, 0.2]) {
|
||||
difference() {
|
||||
scale([5, 5, 5]) rotate(45, [0, 0, 1]) bottle_clip(name="c3cat");
|
||||
scale([5, 5, 5]) rotate(45, [0, 0, 1]) bottle_clip(name=NAME);
|
||||
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();
|
||||
}
|
||||
|
@ -60,22 +70,42 @@ scale([0.2, 0.2, 0.2]) {
|
|||
rotate(180) translate([0, 5*5, 0]) catear();
|
||||
}
|
||||
|
||||
module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/orbitron.dxf", logo="") {
|
||||
module name(name, font, rl, ht, ru) {
|
||||
writecylinder(
|
||||
text=name,
|
||||
where=[0,0,0],
|
||||
radius=rl+0.5,
|
||||
height=ht/13*7,
|
||||
h=ht/13*4,
|
||||
t=max(rl,ru),
|
||||
font=font);
|
||||
}
|
||||
|
||||
e=100; // should be big enough, used for the outer boundary of the text/logo
|
||||
|
||||
difference() {
|
||||
rotate([0,0,-45]) union() {
|
||||
// main cylinder
|
||||
cylinder(r1=rl+width, r2=ru+width, h=ht);
|
||||
// text and logo
|
||||
if(logo == "") {
|
||||
color("orange") writecylinder(name, [0,0,0], rl+0.5, ht/13*7, h=ht/13*4, t=max(rl,ru), font=font);
|
||||
translate([4.7, -rl, ht*1.08]) rotate(-10, [1, 0, 0]) rotate(76, [0, 1, 0]) scale([0.08, 2, 0.08]) color("red") import("catears.stl");
|
||||
} else {
|
||||
color("orange") writecylinder(name, [0,0,0], rl+0.5, ht/13*7, h=ht/13*4, t=max(rl,ru), font=font);
|
||||
|
||||
// The logo has been split in 3 parts.
|
||||
module logo(logo, rl, ht, ru, width) {
|
||||
echo("logo: ", logo);
|
||||
if(logo == "") {
|
||||
ear_size=ht;
|
||||
echo("ht: ", ht);
|
||||
echo("ru: ", ru);
|
||||
echo("rl: ", rl);
|
||||
echo("width: ", width);
|
||||
translate([0,-max(ru,rl),ht*3/4+.5])
|
||||
rotate([90,0,0])
|
||||
scale([1,1,1])
|
||||
scale([ht/100,ht/100,1])
|
||||
translate([0, -ht/2,0])
|
||||
rotate(-90, [0, 0, 1])
|
||||
catear_headband(
|
||||
size=ear_size,
|
||||
height=max(ru,rl),
|
||||
thickness=width,
|
||||
stretch_len=0,
|
||||
tip_len=0,
|
||||
details=false,
|
||||
with_rake=false
|
||||
);
|
||||
} else {
|
||||
// The logo has been split in 3 parts. // well was... TODO
|
||||
/*
|
||||
rotate([0,0,-48]) translate([0,0,ht*3/4-0.1])
|
||||
rotate([90,0,0])
|
||||
|
@ -101,6 +131,32 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/o
|
|||
linear_extrude(height=max(ru,rl)*2)
|
||||
import("logo_3.dxf");
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/orbitron.dxf", logo="") {
|
||||
|
||||
e=100; // should be big enough, used for the outer boundary of the text/logo
|
||||
|
||||
difference() {
|
||||
rotate([0,0,-45]) union() {
|
||||
// main cylinder
|
||||
if (RENDER_COLOR_ONE) {
|
||||
color("black")
|
||||
difference() {
|
||||
cylinder(r1=rl+width, r2=ru+width, h=ht);
|
||||
name(name=name, font=font, rl=rl, ht=ht, ru=ru);
|
||||
logo(logo=logo, rl=rl, ht=ht, ru=ru, width=width);
|
||||
}
|
||||
}
|
||||
// text
|
||||
if (RENDER_COLOR_TWO) {
|
||||
color("orange")
|
||||
name(name=name, font=font, rl=rl, ht=ht, ru=ru);
|
||||
}
|
||||
// logo
|
||||
if (RENDER_COLOR_THREE) {
|
||||
color("yellow") logo(logo=logo, rl=rl, ht=ht, ru=ru, width=2*width);
|
||||
}
|
||||
}
|
||||
// inner cylinder which is substracted
|
||||
|
@ -121,9 +177,11 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/o
|
|||
}
|
||||
|
||||
module catear() {
|
||||
rotate(-90, [0, 0, 1]) union() {
|
||||
scale([1, 1 ,1]) translate([0, -85]) import("catear.stl");
|
||||
scale([1, -1, 1]) translate([0, -85]) import("catear.stl");
|
||||
if (USE_TINY_EARS) {
|
||||
rotate(-90, [0, 0, 1]) union() {
|
||||
scale([1, 1 ,1]) translate([0, -85]) import("catear.stl");
|
||||
scale([1, -1, 1]) translate([0, -85]) import("catear.stl");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue