Code cleaning + add ears to the bottle clip! #22
2 changed files with 17 additions and 5 deletions
Add the HAS_EARS var and rename the RENDER_EARS to RENDER_COLOR_EARS
Add the HAS_EARS variable to be able to generate bottle clips without ears. Rename the RENDER_EARS to RENDER_COLOR_EARS
commit
e2aa0c2a83
|
|
@ -39,6 +39,8 @@ FONT = ""; // empty string is for Orbitron font
|
||||||
// Format of the bottle clip you want to create.
|
// Format of the bottle clip you want to create.
|
||||||
FORMAT = 3; // [0=Club Mate 50cL, 1=Long Neck as 25cL Club Mate or Fritz-kola, 2=Euroform 2, 3=Steinie bottles]
|
FORMAT = 3; // [0=Club Mate 50cL, 1=Long Neck as 25cL Club Mate or Fritz-kola, 2=Euroform 2, 3=Steinie bottles]
|
||||||
|
|
||||||
|
// Append ears to the bottle clip
|
||||||
|
HAS_EARS = true;
|
||||||
|
|
||||||
/* [Render] */
|
/* [Render] */
|
||||||
// Whether to render the clip, the body.
|
// Whether to render the clip, the body.
|
||||||
|
|
@ -47,8 +49,8 @@ RENDER_COLOR_CLIP = true;
|
||||||
RENDER_COLOR_TEXT = true;
|
RENDER_COLOR_TEXT = true;
|
||||||
// Whether to render the logo part.
|
// Whether to render the logo part.
|
||||||
RENDER_COLOR_LOGO = true;
|
RENDER_COLOR_LOGO = true;
|
||||||
// Add ears to the clip.
|
// Whether to render the cat ears part.
|
||||||
USE_TINY_EARS = true;
|
RENDER_COLOR_EARS = true;
|
||||||
|
|
||||||
// Set the number of facets for circles.
|
// Set the number of facets for circles.
|
||||||
$fn = 360;
|
$fn = 360;
|
||||||
|
|
@ -82,7 +84,7 @@ scale([0.2, 0.2, 0.2]) {
|
||||||
font=FONT,
|
font=FONT,
|
||||||
logo=LOGO_FILE,
|
logo=LOGO_FILE,
|
||||||
format=FORMAT,
|
format=FORMAT,
|
||||||
has_ears=USE_TINY_EARS);
|
has_ears=HAS_EARS);
|
||||||
}
|
}
|
||||||
|
|
||||||
module render_bottle_clip(name="", font="", logo="", format=0, has_ears=true) {
|
module render_bottle_clip(name="", font="", logo="", format=0, has_ears=true) {
|
||||||
|
|
@ -122,7 +124,7 @@ module render_bottle_clip(name="", font="", logo="", format=0, has_ears=true) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render ears if requested
|
// Render ears if requested
|
||||||
if (has_ears) {
|
if (has_ears && RENDER_COLOR_EARS) {
|
||||||
ears(ht=ht, ru=ru, rl=rl);
|
ears(ht=ht, ru=ru, rl=rl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,16 +18,25 @@ render() {
|
||||||
CLIP=true
|
CLIP=true
|
||||||
TEXT=false
|
TEXT=false
|
||||||
LOGO=false
|
LOGO=false
|
||||||
|
EARS=false
|
||||||
;;
|
;;
|
||||||
name)
|
name)
|
||||||
CLIP=false
|
CLIP=false
|
||||||
TEXT=true
|
TEXT=true
|
||||||
LOGO=false
|
LOGO=false
|
||||||
|
EARS=false
|
||||||
;;
|
;;
|
||||||
logo)
|
logo)
|
||||||
CLIP=false
|
CLIP=false
|
||||||
TEXT=false
|
TEXT=false
|
||||||
LOGO=true
|
LOGO=true
|
||||||
|
EARS=false
|
||||||
|
;;
|
||||||
|
ears)
|
||||||
|
CLIP=false
|
||||||
|
TEXT=false
|
||||||
|
LOGO=false
|
||||||
|
EARS=true
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo 'fatal: invalid part' >&2
|
echo 'fatal: invalid part' >&2
|
||||||
|
|
@ -50,6 +59,7 @@ render() {
|
||||||
-D "RENDER_COLOR_CLIP=${CLIP}" \
|
-D "RENDER_COLOR_CLIP=${CLIP}" \
|
||||||
-D "RENDER_COLOR_TEXT=${TEXT}" \
|
-D "RENDER_COLOR_TEXT=${TEXT}" \
|
||||||
-D "RENDER_COLOR_LOGO=${LOGO}" \
|
-D "RENDER_COLOR_LOGO=${LOGO}" \
|
||||||
|
-D "RENDER_COLOR_EARS=${EARS}" \
|
||||||
-o "stls/c3cat-bottle-clip-v${VERSION}_BOTTLE${BOTTLE_FORMAT}_${NAME}_${PART}.stl" \
|
-o "stls/c3cat-bottle-clip-v${VERSION}_BOTTLE${BOTTLE_FORMAT}_${NAME}_${PART}.stl" \
|
||||||
c3cat-bottle-clip/c3cat-bottle-clip.scad
|
c3cat-bottle-clip/c3cat-bottle-clip.scad
|
||||||
}
|
}
|
||||||
|
|
@ -59,7 +69,7 @@ cd "$(dirname $0)"
|
||||||
for BOTTLE_FORMAT in 0 1 2
|
for BOTTLE_FORMAT in 0 1 2
|
||||||
do
|
do
|
||||||
echo "Generating bottle format ${BOTTLE_FORMAT}"
|
echo "Generating bottle format ${BOTTLE_FORMAT}"
|
||||||
for PART in body logo name
|
for PART in body logo name ears
|
||||||
do
|
do
|
||||||
render "$NAME" "$PART" "$BOTTLE_FORMAT"
|
render "$NAME" "$PART" "$BOTTLE_FORMAT"
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue