make logo optional. In this case, the text uses the total width of the name tag.
This commit is contained in:
parent
35bdbc92a4
commit
edee712666
1 changed files with 20 additions and 12 deletions
|
@ -13,7 +13,9 @@ include <write/Write.scad>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates one instance of a bottle clip name tag. The default values are
|
* Creates one instance of a bottle clip name tag. The default values are
|
||||||
* suitable for 0.5l Club Mate bottles (and similar bottles).
|
* suitable for 0.5l Club Mate bottles (and similar bottles). By default, logo
|
||||||
|
* and text are placed on the name tag so they both share half the height. If
|
||||||
|
* there is no logo, the text uses the total height instead.
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* ru: the radius on the upper side of the clip
|
* ru: the radius on the upper side of the clip
|
||||||
* rl: the radius on the lower side of the clip
|
* rl: the radius on the lower side of the clip
|
||||||
|
@ -25,21 +27,26 @@ include <write/Write.scad>
|
||||||
* logo: the path to a DXF file representing a logo that should be put above
|
* logo: the path to a DXF file representing a logo that should be put above
|
||||||
* the name. Logo files should be no larger than 50 units in height and should
|
* the name. Logo files should be no larger than 50 units in height and should
|
||||||
* be centered on the point (25,25). Also all units in the DXF file should be
|
* be centered on the point (25,25). Also all units in the DXF file should be
|
||||||
* in mm.
|
* in mm. This parameter can be empty; in this case, the text uses the total
|
||||||
|
* height of the name tag.
|
||||||
* font: the path to a font for Write.scad.
|
* font: the path to a font for Write.scad.
|
||||||
*/
|
*/
|
||||||
module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="",
|
module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="",
|
||||||
logo="thing-logos/stratum0-lowres.dxf", font="write/orbitron.dxf") {
|
logo="thing-logos/stratum0-lowres.dxf", font="write/orbitron.dxf") {
|
||||||
|
|
||||||
e=100; // should be big enough, used for the outer boundary of the text/logo
|
e=100; // should be big enough, used for the outer boundary of the text/logo
|
||||||
|
|
||||||
difference() {
|
difference() {
|
||||||
rotate([0,0,-45]) union() {
|
rotate([0,0,-45]) union() {
|
||||||
// main cylinder
|
// main cylinder
|
||||||
cylinder(r1=rl+width, r2=ru+width, h=ht);
|
cylinder(r1=rl+width, r2=ru+width, h=ht);
|
||||||
// text
|
// text and logo
|
||||||
|
if(logo == "") {
|
||||||
|
writecylinder(name, [0,0,3], rl+0.5, ht/13*7, h=ht/13*8, t=max(rl,ru),
|
||||||
|
font=font);
|
||||||
|
} else {
|
||||||
writecylinder(name, [0,0,0], rl+0.5, ht/13*7, h=ht/13*4, t=max(rl,ru),
|
writecylinder(name, [0,0,0], rl+0.5, ht/13*7, h=ht/13*4, t=max(rl,ru),
|
||||||
font=font);
|
font=font);
|
||||||
// logo
|
|
||||||
translate([0,0,ht*3/4-0.1])
|
translate([0,0,ht*3/4-0.1])
|
||||||
rotate([90,0,0])
|
rotate([90,0,0])
|
||||||
scale([ht/100,ht/100,1])
|
scale([ht/100,ht/100,1])
|
||||||
|
@ -47,6 +54,7 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="",
|
||||||
linear_extrude(height=max(ru,rl)*2)
|
linear_extrude(height=max(ru,rl)*2)
|
||||||
import(logo);
|
import(logo);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// inner cylinder which is substracted
|
// inner cylinder which is substracted
|
||||||
translate([0,0,-1])
|
translate([0,0,-1])
|
||||||
cylinder(r1=rl, r2=ru, h=ht+2);
|
cylinder(r1=rl, r2=ru, h=ht+2);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue