Skip to content

Instantly share code, notes, and snippets.

@idcrook
Last active July 1, 2020 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idcrook/56b3f4985984cc609ef8fb3ae3dc32a9 to your computer and use it in GitHub Desktop.
Save idcrook/56b3f4985984cc609ef8fb3ae3dc32a9 to your computer and use it in GitHub Desktop.
Recreate mesh of Instruments
#!/bin/bash -x
for j in `seq 0 144`;do
i=`printf "%04d" $j`
r=`expr 5 \* $j`
openscad -o logo_anim-$i.png app_icon_model.scad --preview --camera=0,0,0,90,0,$r,415 --colorscheme="Tomorrow Night" --projection=o
done
size = 100;
// https://openscadsnippetpad.blogspot.com/2017/06/figure-eight-path.html
function figure8(m=size)=[for(t=[0:1:360])
let(scale = 2 / (3 - cos(2*t)),x =m* scale * cos(t),y =m* scale * sin(2*t) / 2)
[x,y]];
function close(p)= concat(p,[p[0]]);
module polyline(p) {for(i=[0:max(0,len(p)-2)])line(p[i],p[i+1]);}
module line(p1, p2, width=(size/7)/2.0)
{
hull() {
translate(p1) sphere(width);
translate(p2) sphere(width);
}
}
module one_symbol() {
polyline(close(figure8(size/2)));
}
module assembly2 () {
x_off = 16.5;
z_off = 23;
translate([-x_off,0,0])
//rotate([45/2 , 90 + 30, 45/2])
rotate([0 , 90 + 30, 0])
rotate([0 , 0, -15])
one_symbol();
translate([x_off,0,0])
rotate([0, -(90 + 30), 0])
rotate([0 , 0, -15])
one_symbol();
translate([0,0,-z_off])
rotate([0 , 0, -15])
rotate([0 , 0, 0])
one_symbol();
}
show_assembly = true;
// $preview requires version 2019.05
fn = $preview ? 30 : 100;
if (show_assembly) {
scale ([1.0,1.0,1.0])
translate([0,0,0])
rotate([0,0,0])
assembly2();
} else {
scale ([1.0,1.0,1.0])
translate([0,0,0])
rotate([0,0,0])
one_symbol();
}
#!/bin/bash -x
convert 'logo_anim-*.png' -set delay 1x24 animated.gif
#!/bin/bash -x
ffmpeg -f image2 -i logo_anim-%04d.png -vcodec libx264 -b 1M -pix_fmt yuv420p -y -r 12 logo_anim.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment