// jack-o-lantern // Copyright Algot Runeman, 2019 // This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. // You should have received a copy of the GNU General Public License along with this program. If not, see . // version00 - 2019-10-29 // version01 - 2019-10-29 - fancy eye // version02 - 2019-10-29 - invert eyes and mouth - still need to fix mouth to parametric format // version03 - intermediate parametric fix // version04 - all components linked to sz // version05 - add comments, etc. 2019-10-29 // VARIABLES sz=50; // MODULES // basic pumpkin module basic(){ for(x=[0:30:150]){ rotate([0,0,x]) scale([.5,1,1]) sphere(sz); } } module eye(){ // developed with hanging pupil linear_extrude(sz*.33) polygon ( points=[[0,0],[10.58,0],[26.45,7.93],[21.16,23.70],[10.58,26.45],[15.87,15.87],[13.22,7.93],[-1.3,7.9],[-5.2,15.8],[0,26.5],[-13.2,15.9],[-7.9,2.6]], paths=[[0,1,2,3,4,5,6,7,8,9,10,11,0]],convexity=10); } module nose(){ linear_extrude(sz) polygon ( points=[[-5,0],[5,0],[0,10]], paths=[[0,1,2,0]],convexity=10); } module mouth(){ linear_extrude(sz) polygon ( points=[[-36.6,9.4],[-25.9,2.8],[-8.3,-3.8],[-8.3,1.1],[-3.3,1.1],[-3.3,-3.8],[3.2,-3.8],[3.2,1.1],[8.2,1.1],[8.2,-3.8],[26.9,2.8],[34.8,9.4],[8.2,4.4],[-10,4.4]], paths=[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,0]],convexity=10); } // EXECUTE translate([0,0,sz*.8-1.5]) // z=0 scale([1,1,.8]) // squash it difference(){ basic(); sphere(sz*.9); // remove insides translate([0,0,-sz]) cylinder(2,sz/2,sz/2); // flat base //} // comment out for difference to work //translate([0,0,sz]){ // comment out, too // left eye translate([0,0,sz*.4]) rotate([90,180,-25]) // invert for pupil resize([sz*.4,sz*.4,sz]) eye(); // right eye translate([0,0,sz*.4]) rotate([90,180,35]) // invert for pupil resize([sz*.4,sz*.4,sz]) eye(); // nose translate([0,0,-sz*.1]) rotate([90,0,0]) resize([sz*.35,sz*.35,sz]) nose(); // mouth translate([0,-sz/2,-sz*.4]) rotate([90,0,0]) resize([sz*1.2,sz*.3,sz/2]) mouth(); } // stem translate([0,0,sz*1.4]) rotate([0,10,0]) cylinder(sz*.33,sz*.2,sz*.14); translate([sz*.03,0,sz*1.65]) rotate([0,30,0]) cylinder(sz*.2,sz*.15,sz*.11);