Skip to content

Instantly share code, notes, and snippets.

@davidsharp
Last active October 26, 2025 13:35
Show Gist options
  • Select an option

  • Save davidsharp/e1da5ec8487dd33fe7a3df780d9751ec to your computer and use it in GitHub Desktop.

Select an option

Save davidsharp/e1da5ec8487dd33fe7a3df780d9751ec to your computer and use it in GitHub Desktop.
Trying to update my last script, and this generates an interesting mouth, but doesn't actually do what I want, lol
radius = 50;
module smile(){
difference(){
translate([0, 0, 0])
circle(radius);
translate([0, 40, 0])
circle(radius+15);
}
}
module teeth(top,bot,top_gap=8,bot_gap=10,sides=3){
tooth_rot = sides == 4 ? 45 : 90;
top_offset = top % 2 == 0 ? 0.5 : 0;
bot_offset = bot % 2 == 0 ? 0.5 : 0;
for(i=[0:1:top-1]){
translate([0,40,0])
rotate([0,0,180+((i+top_offset-1)*top*top_gap)])
translate([0,radius+15,0])
rotate([0,0,tooth_rot])
circle(8,$fn=sides);
}
for(i=[0:1:bot-1]){
rotate([0,0,180+((i+bot_offset-1)*bot*bot_gap)])
translate([0,radius,0])
rotate([0,0,tooth_rot+180])
circle(6,$fn=sides);
}
}
linear_extrude(3)
difference(){
smile();
teeth(3,2,8,15,3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment