scad/Bunny Cookie Cutter/bunny.scad

84 lines
160 KiB
OpenSCAD
Raw Permalink Normal View History

2024-06-24 15:56:57 +02:00
// Module names are of the form poly_<inkscape-path-id>(). As a result,
// you can associate a polygon in this OpenSCAD program with the corresponding
// SVG element in the Inkscape document by looking for the XML element with
// the attribute id="inkscape-path-id".
// fudge value is used to ensure that subtracted solids are a tad taller
// in the z dimension than the polygon being subtracted from. This helps
// keep the resulting .stl file manifold.
fudge = 0.1;
zsize = 5;
line_fn = 1;
min_line_width = 0.4;
function min_line_mm(w) = max(min_line_width, w) * 90/25.4;
path871_0_center = [-0.000000,-0.000000];
path871_0_points = [[3.040405,-58.691012],[2.909428,-58.688943],[2.778411,-58.686551],[2.647353,-58.683835],[2.516254,-58.680792],[2.385114,-58.677420],[2.253933,-58.673717],[2.122710,-58.669682],[1.991445,-58.665313],[1.860138,-58.660607],[1.728789,-58.655563],[1.597397,-58.650180],[1.465962,-58.644454],[1.334484,-58.638385],[1.202962,-58.631970],[1.071397,-58.625207],[0.939787,-58.618095],[0.808134,-58.610632],[0.676436,-58.602816],[0.544693,-58.594644],[0.412905,-58.586116],[0.281072,-58.577229],[0.149193,-58.567981],[0.017269,-58.558370],[-0.114702,-58.548395],[-0.246719,-58.538053],[-0.378782,-58.527343],[-0.510892,-58.516263],[-0.643050,-58.504811],[-0.775254,-58.492985],[-0.907507,-58.480783],[-1.039807,-58.468204],[-1.172156,-58.455245],[-1.304553,-58.441904],[-1.436998,-58.428180],[-1.569493,-58.414071],[-1.702037,-58.399575],[-1.834630,-58.384689],[-1.967273,-58.369413],[-2.099966,-58.353744],[-2.232709,-58.337680],[-2.365503,-58.321219],[-2.498347,-58.304360],[-2.631243,-58.287101],[-2.764190,-58.269440],[-2.897188,-58.251374],[-3.030238,-58.232903],[-3.163340,-58.214023],[-3.296495,-58.194734],[-3.429702,-58.175033],[-3.562962,-58.154919],[-3.696276,-58.134389],[-3.829642,-58.113441],[-3.963063,-58.092075],[-4.096537,-58.070287],[-4.230065,-58.048077],[-4.363648,-58.025442],[-4.497286,-58.002379],[-4.630978,-57.978889],[-4.764726,-57.954967],[-4.898529,-57.930614],[-5.032388,-57.905826],[-5.166303,-57.880601],[-5.300274,-57.854939],[-5.434302,-57.828837],[-5.568386,-57.802293],[-5.702528,-57.775305],[-5.836727,-57.747872],[-5.970983,-57.719991],[-6.105298,-57.691660],[-6.239670,-57.662879],[-6.374101,-57.633644],[-6.508590,-57.603954],[-6.643138,-57.573808],[-6.777746,-57.543202],[-6.912413,-57.512136],[-7.047139,-57.480607],[-7.181926,-57.448614],[-7.316772,-57.416154],[-7.451679,-57.383226],[-7.586647,-57.349828],[-7.721676,-57.315958],[-7.856766,-57.281614],[-7.991917,-57.246794],[-8.127131,-57.211497],[-8.262406,-57.175720],[-8.397743,-57.139461],[-8.533143,-57.102719],[-8.668606,-57.065492],[-8.804132,-57.027778],[-8.939722,-56.989575],[-9.075375,-56.950881],[-9.211091,-56.911694],[-9.346872,-56.872013],[-9.482717,-56.831835],[-9.618627,-56.791158],[-9.754602,-56.749981],[-9.890642,-56.708302],[-10.026747,-56.666119],[-10.162918,-56.623430],[-10.299155,-56.580233],[-10.435459,-56.536527],[-10.571828,-56.492309],[-10.708265,-56.447577],[-10.844768,-56.402330],[-10.981339,-56.356565],[-11.117977,-56.310281],[-11.254683,-56.263477],[-11.391457,-56.216149],[-11.528299,-56.168296],[-11.665210,-56.119917],[-11.802189,-56.071009],[-11.939238,-56.021571],[-12.076356,-55.971600],[-12.213544,-55.921095],[-12.350801,-55.870054],[-12.488129,-55.818475],[-12.625527,-55.766356],[-12.762996,-55.713695],[-12.900535,-55.660490],[-13.038146,-55.606740],[-13.175828,-55.552442],[-13.313582,-55.497595],[-13.451408,-55.442197],[-13.589306,-55.386246],[-13.727277,-55.329739],[-13.865320,-55.272676],[-14.003436,-55.215054],[-14.141626,-55.156871],[-14.260457,-55.106448],[-14.378714,-55.055939],[-14.496399,-55.005346],[-14.613512,-54.954667],[-14.730057,-54.903904],[-14.846035,-54.853057],[-14.961447,-54.802126],[-15.076297,-54.751111],[-15.190585,-54.700012],[-15.304314,-54.648831],[-15.417485,-54.597566],[-15.530100,-54.546218],[-15.642162,-54.494788],[-15.753672,-54.443276],[-15.864631,-54.391682],[-15.975043,-54.340006],[-16.084908,-54.288249],[-16.194228,-54.236411],[-16.303007,-54.184491],[-16.411244,-54.132491],[-16.518943,-54.080411],[-16.626104,-54.028251],[-16.732731,-53.976010],[-16.838824,-53.923690],[-16.944387,-53.871290],[-17.049419,-53.818812],[-17.153925,-53.766254],[-17.257904,-53.713618],[-17.361360,-53.660904],[-17.464294,-53.608111],[-17.566708,-53.555241],[-17.668604,-53.502293],[-17.769983,-53.449268],[-17.870848,-53.396165],[-17.971201,-53.342986],[-18.071042,-53.289731],[-18.170376,-53.236399],[-18.269202,-53.182991],[-18.367523,-53.129507],[-18.465341,-53.075948],[-18.562658,-53.022313],[-18.659476,-52.968603],[-18.755796,-52.914819],[-18.851620,-52.860960],[-18.946951,-52.807027],[-19.041789,-52.75302
module poly_path871(h, w, s, res=line_fn)
{
scale([25.4/90, -25.4/90, 1]) union()
{
for (t = [0: len(path871_0_points)-2]) {
hull() {
translate(path871_0_points[t])
cylinder(h=h, r=w/2, $fn=res);
translate(path871_0_points[t + 1])
cylinder(h=h, r=w/2, $fn=res);
}
}
}
}
path877_0_center = [-1.531532,32.411594];
path877_0_points = [[-19.440712,49.627824],[-19.424014,49.576692],[-19.407183,49.525771],[-19.390218,49.475060],[-19.373120,49.424560],[-19.355890,49.374269],[-19.338526,49.324187],[-19.321030,49.274314],[-19.303402,49.224650],[-19.285642,49.175193],[-19.267750,49.125945],[-19.249727,49.076904],[-19.231573,49.028070],[-19.213288,48.979442],[-19.194873,48.931021],[-19.176327,48.882806],[-19.157651,48.834796],[-19.138845,48.786991],[-19.119910,48.739391],[-19.100846,48.691995],[-19.081652,48.644803],[-19.062330,48.597815],[-19.042880,48.551030],[-19.023301,48.504448],[-19.003594,48.458068],[-18.983760,48.411890],[-18.963798,48.365914],[-18.943709,48.320140],[-18.923494,48.274566],[-18.903151,48.229193],[-18.882683,48.184019],[-18.862088,48.139046],[-18.841367,48.094272],[-18.820521,48.049697],[-18.799550,48.005321],[-18.778453,47.961143],[-18.757232,47.917162],[-18.735886,47.873380],[-18.714416,47.829794],[-18.692823,47.786405],[-18.671105,47.743213],[-18.649264,47.700216],[-18.627300,47.657415],[-18.605213,47.614810],[-18.583003,47.572399],[-18.560671,47.530182],[-18.538217,47.488160],[-18.515641,47.446331],[-18.492943,47.404696],[-18.470124,47.363253],[-18.447184,47.322003],[-18.424123,47.280946],[-18.400942,47.240080],[-18.377640,47.199405],[-18.354218,47.158922],[-18.330677,47.118629],[-18.307016,47.078526],[-18.283236,47.038613],[-18.259337,46.998890],[-18.235319,46.959356],[-18.211183,46.920011],[-18.186929,46.880854],[-18.162557,46.841885],[-18.138067,46.803104],[-18.113460,46.764510],[-18.088735,46.726102],[-18.063894,46.687881],[-18.038937,46.649847],[-18.013863,46.611998],[-17.988673,46.574334],[-17.963367,46.536855],[-17.937946,46.499561],[-17.912409,46.462451],[-17.886758,46.425525],[-17.860992,46.388782],[-17.835111,46.352222],[-17.809116,46.315845],[-17.783007,46.279651],[-17.756785,46.243638],[-17.730449,46.207806],[-17.704000,46.172156],[-17.677438,46.136687],[-17.650764,46.101398],[-17.623977,46.066289],[-17.597078,46.031359],[-17.570067,45.996609],[-17.542945,45.962038],[-17.515711,45.927645],[-17.488367,45.893430],[-17.460912,45.859393],[-17.433346,45.825534],[-17.405670,45.791851],[-17.377884,45.758345],[-17.349988,45.725015],[-17.321983,45.691861],[-17.293869,45.658882],[-17.265646,45.626079],[-17.237314,45.593450],[-17.208873,45.560995],[-17.180325,45.528715],[-17.151669,45.496607],[-17.122905,45.464673],[-17.094034,45.432912],[-17.065056,45.401323],[-17.035971,45.369907],[-17.006780,45.338662],[-16.977482,45.307588],[-16.948078,45.276685],[-16.918569,45.245952],[-16.888954,45.215390],[-16.859233,45.184997],[-16.829408,45.154774],[-16.799479,45.124720],[-16.769444,45.094834],[-16.739306,45.065116],[-16.709064,45.035567],[-16.678718,45.006185],[-16.648269,44.976969],[-16.617716,44.947921],[-16.587061,44.919039],[-16.556303,44.890323],[-16.525443,44.861772],[-16.494481,44.833387],[-16.463418,44.805166],[-16.432252,44.777110],[-16.400986,44.749218],[-16.369618,44.721489],[-16.338150,44.693924],[-16.306581,44.666522],[-16.274912,44.639282],[-16.243143,44.612204],[-16.211275,44.585288],[-16.179307,44.558534],[-16.147240,44.531940],[-16.115074,44.505507],[-16.082809,44.479234],[-16.050446,44.453122],[-16.017986,44.427168],[-15.985427,44.401374],[-15.952770,44.375738],[-15.920017,44.350261],[-15.887166,44.324942],[-15.854219,44.299780],[-15.821175,44.274775],[-15.788035,44.249928],[-15.754799,44.225236],[-15.721467,44.200701],[-15.688040,44.176322],[-15.654518,44.152097],[-15.620901,44.128028],[-15.587189,44.104113],[-15.553382,44.080353],[-15.519482,44.056746],[-15.485488,44.033292],[-15.451400,44.009992],[-15.417219,43.986844],[-15.382945,43.963848],[-15.348578,43.941004],[-15.314118,43.918312],[-15.279566,43.895771],[-15.244923,43.873381],[-15.210187,43.851140],[-15.175360,43.829050],[-15.140442,43.807110],[-15.105433,43.785319],[-15.070333,43.763676],[-15.035143,43.742182],[-14.999862,43.720836],[-14.964492,43.699638],[-14.929032,43.678587],[-14.893483,43.657683],[-14.857845,43.636925],[-14.822117,43.616314],[-14.786302,43.595848],[-14.750398,43.575528],[-14.714406,43.555353],[-14.678326,43.535323],[-14
module poly_path877(h, w, s, res=line_fn)
{
scale([25.4/90, -25.4/90, 1]) union()
{
for (t = [0: len(path877_0_points)-2]) {
hull() {
translate(path877_0_points[t])
cylinder(h=h, r=w/2, $fn=res);
translate(path877_0_points[t + 1])
cylinder(h=h, r=w/2, $fn=res);
}
}
}
}
module bunny(h)
{
difference()
{
union()
{
translate ([0,0,0]) poly_path871(h, min_line_mm(.5), 100.0);
translate ([0,0,0]) poly_path877(h-1, min_line_mm(.5), 100.0);
}
union()
{
}
}
}
module bunny2(h)
{
difference()
{
union()
{
translate ([0,0,0]) poly_path871(h, min_line_mm(2), 100.0);
translate ([0,0,0]) poly_path877(h, min_line_mm(2), 100.0);
}
union()
{
}
}
}
scale([2,2,1]){
bunny(10);
bunny2(1);
}