Add cat ears

This commit is contained in:
polyfloyd 2025-05-04 19:24:04 +02:00
parent 0763961823
commit febf25566d
3 changed files with 61 additions and 35 deletions

View file

@ -26,6 +26,10 @@ on:
- pixel-cats/spooked-right.svg
- pixel-cats/standing-left.svg
- pixel-cats/standing-right.svg
ears:
description: 'Cat Ears'
default: false
type: boolean
jobs:
@ -47,6 +51,7 @@ jobs:
env:
LABEL: "${{ inputs.label }}"
ICON: "${{ inputs.icon }}"
EARS: "${{ inputs.ears }}"
- name: Render to STL
run: openscad --export-format binstl -o bottle-clip.stl ci.scad

View file

@ -58,11 +58,14 @@ module multicolor(color) {
* text_color: The color of the text
* logo_color: The color of the logo
*/
module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="", gap=90,
module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="", gap=90, ears=false,
logo="thing-logos/stratum0-lowres.dxf", font="write/orbitron.dxf",
bg_color="DEFAULT", text_color="DEFAULT", logo_color="DEFAULT") {
e=100; // should be big enough, used for the outer boundary of the text/logo
difference() {
union() {
difference() {
rotate([0,0,-45]) union() {
// main cylinder
@ -82,9 +85,6 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="", gap=90,
import(logo);
}
}
// inner cylinder which is substracted
translate([0,0,-1])
cylinder(r1=rl, r2=ru, h=ht+2);
// outer cylinder which is substracted, so the text and the logo end
// somewhere on the outside ;-)
difference () {
@ -103,6 +103,27 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="", gap=90,
linear_extrude(height=50)
polygon(points=[[0,0], [gap_x, gap_y], [50,50], [gap_y, gap_x]]);
}
// Cat ears!
if (ears) {
ear_size = 8;
rotate([0, 0, 45])
for (m = [0 : 1]) mirror([0, m, 0])
rotate([0, 0, -60])
translate([0, 0, ht-3])
rotate([0, -90, 0])
translate([0, 0, ru])
rotate([0, -30, 0])
// Ear solid
translate([0,0,-1])
linear_extrude(2)
polygon(points = [ [0, -ear_size], [0, ear_size], [ear_size*2, 1], [ear_size*2, -1] ]);
}
}
// inner cylinder which is substracted
translate([0,0,-1])
cylinder(r1=rl, r2=ru, h=ht+2);
}
}
/**

View file

@ -1,3 +1,3 @@
include <bottle-clip.scad>
bottle_clip(name="$LABEL", logo="$ICON");
bottle_clip(name="$LABEL", logo="$ICON", ears=$EARS);