Controls:
seconds
|
Demos:
OpenSCAD Code
Input Params
HTML Form
Output Params
STL Viewer
Rotate:
Draw:
flat
smooth
wireframe
// These are global parameters of the figure. /* [ Low Polygon Vase ] */ // Total height h = 100; // [1:1:200] // Number of layers layers = 20; // [10:1:100] // Number of sides sides = 8; // [3:1:50] // These are parameters to rfunction(), the function that // determines the radius for a particular vertical point. // Different variations on rfunction might use different // parameters. // Basic radius r = 20; // [10:1:50] // Radius varies sinusoidally this much ramplitude = 10; // [10:1:15] // Sine wave has this wavelength rwavelength = 100; // [40:1:200] // Start this many degrees into the sine wave rphase = 0; //[0:1:359] // This is the one parameter to afunction(), the function that // Different variations on afunction might use different // parameters. // Determines the twist at a particular vertical point. twist = 90; //[0:1:359] // Given a vertical index in [0:layers], return the radius // at that point. // This function varies radius by a sine wave. function rfunction(i) = r + ramplitude*sin(rphase + 360*h/rwavelength*i/layers); // Given a vertical index in [0:layers], return the twist // (from zero, not from the previous layer) at that point. function afunction(i) = twist*i/layers; // The rest is pretty independent of the shape, generating // a circle-ish thing with per-layer radius and twist. // Generate the points for a single layer // a - start angle for this layer // r - radius for this layer // z - altitude for this layer function layer(a, r, z) = let(step = 360/sides) [ for (i=[0:sides-1]) let(theta=i*step + a) [ r*cos(theta), r*sin(theta), z ] ]; // Generate all of the points for the object. points = [ for(i=[0:layers]) each layer(afunction(i), rfunction(i), h*i/layers), [0,0,0], // bottom center [0,0,h] // top center ]; // Total number of points in the exterior of the figure, not // counting the bottom and top center points. npoints = (layers+1)*sides; bottomcenter = npoints; topcenter = npoints+1; // Generate the faces faces = [ // The bottom for (j = [0:sides-1]) let(k = (j+1)%sides) [j, k, bottomcenter], // The body for(i=[0:layers-1]) for(j=[0:sides-1]) // k is the index of the next point counterclockwise. let(k = (j+1)%sides) // Build triangles one way or the other, depending on // which way we are twisting in this layer. if (afunction(i) > afunction(i+1)) // Divide quad bottom-left to top-right each [ [i*sides + j, (i+1)*sides + k, i*sides + k], [i*sides + j, (i+1)*sides + j, (i+1)*sides + k] ] else // Divide quad top-left to bottom-right each [ [i*sides + j, (i+1)*sides + j, i*sides + k], [(i+1)*sides + j, (i+1)*sides + k, i*sides + k] ], // The top for (j = [0:sides-1]) let(k = (j+1)%sides) [layers*sides+k, layers*sides+j, npoints+1], ]; polyhedron(points=points, faces=faces, convexity=10);
//http://www.wolframalpha.com/input/?i=Archimedes%E2%80%99+spiral /* [Archimedes Spiral Generator] */ $fn = 3; //http://www.wolframalpha.com/input/?i=Archimedes%E2%80%99+spiral spirals = 1; a = 0.07; incrementBy = 40; height = 10; wallThickness = 8; rotate([90,0,0]) for(i=[0:360/spirals:360]) rotate([0,0,i]) for(t=[0:incrementBy:1000]) hull(){ translate([a*t*cos(t),a*t*sin(t),0]) cube([wallThickness/2,wallThickness/2,height]); translate([a*(t+incrementBy)*cos(t+incrementBy),a*(t+incrementBy)*sin(t+incrementBy),0]) cube([wallThickness/2,wallThickness/2,height]); }
/* Snowman Parameters */ // Number of fragments, increases rendering time $fn = 15; // [3:1:128] noseLength = 40; // [40:1:200] module body(){difference(){ sphere(r=43); translate([0,0,-59]) cube(80, center=true); } translate([0,0,45]) sphere(r=35); translate([0,0,80]) sphere(r=27); } body(); translate([0,-1*noseLength/2,85]) nose(); module nose(){ rotate([90,0,0]) cylinder(h = noseLength, r1 = 10, r2 = 1, center = true); } translate([13,-16,95]) sphere(r=5); translate([-12,-16,95]) sphere(r=5);
/*[ Candle Stand ]*/ //Number of fragments $fn=5; // [3:1:50] //Length of candle stand length=50; // [70:large,50:medium,30:small] // Center stand cylinder(length,width-2); //Radius of ring of stand radius=25; /* [ Number of candle holders ]*/ // Number of candle holders count=3; //[3:14] //Do you want center Candle centerCandle=true; /* [ Candle Holder ]*/ //Length of candle holder candleSize=7; //Width of candle holder width=4; //Size of hole for candle holder holeSize=3; CenterCandleWidth=4; /*[Properties of support]*/ heightOfSupport=3; widthOfSupport=3; /*[Properties of Ring]*/ heightOfRing=4; widthOfRing=23; //Create center candle translate([0,0,length-candleSize/2]) if(centerCandle){ difference(){ cylinder(candleSize,r=CenterCandleWidth); cylinder(candleSize+1,r=CenterCandleWidth-2); } }else{ sphere(CenterCandleWidth); } //make ring translate([0,0,length-candleSize/2]){ make(radius, count,candleSize,length); //make bottom cover for candle holders make_ring_of(radius, count){ cylinder(1,r=width); } } //Base of candle stand for (a = [0 : count - 1]) { rotate(a*360/count) { translate([0, -width/2, 0]) cube([radius, widthOfSupport, heightOfSupport]); } } //make ring with candle holders module make(radius, count,candleSize,length){ $fa = 0.5; $fs = 0.5; difference(){ union(){ //making holders make_ring_of(radius, count){ cylinder(candleSize,r=width); } //Attaching holders to stand for (a = [0 : count - 1]) { rotate(a*360/count) { translate([0, -width/2, 0]) cube([radius, widthOfSupport, heightOfSupport]); } } // make ring linear_extrude(heightOfRing, convexity=2) difference(){ circle(radius); circle(widthOfRing); } } //Making holes in candle holder make_ring_of(radius, count){ cylinder(candleSize+1,r=holeSize); } } } module make_ring_of(radius, count){ for (a = [0 : count - 1]) { angle = a * 360 / count; translate(radius * [cos(angle), -sin(angle), 0]) children(); } } // Written by Amarjeet Singh Kapoor <amarjeet.kapoor1@gmail.com> // // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to the // public domain worldwide. This software is distributed without any // warranty. // // You should have received a copy of the CC0 Public Domain // Dedication along with this software. // If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
// Menger Sponge // Size of edge of sponge D=50; // Fractal depth (number of iterations) n=2; echo(version=version()); module menger() { difference() { cube(D, center=true); for (v=[[0,0,0], [0,0,90], [0,90,0]]) rotate(v) menger_negative(side=D, maxside=D, level=n); } } module menger_negative(side=1, maxside=1, level=1) { l=side/3; cube([maxside*1.1, l, l], center=true); if (level > 1) { for (i=[-1:1], j=[-1:1]) if (i || j) translate([0, i*l, j*l]) menger_negative(side=l, maxside=maxside, level=level-1); } } rotate([45, atan(1/sqrt(2)), 0]) menger(); // Written by Nathan Hellweg, Emmett Lalish and Marius Kintel May 13, 2013 // // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to the // public domain worldwide. This software is distributed without any // warranty. // // You should have received a copy of the CC0 Public Domain // Dedication along with this software. // If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
// Number of Fragments (affects load time) $fn = 30; //[10:1:100] // Distance across band (mm) diameter = 65; //[15:1:89] // Thickness of the band (mm) thickness = 4.5; //[3.5:1:5.5] // Height of band (mm) height = 10; //[5:1:25] rotate([45,0,0]) makeBand(diameter, thickness, height); module makeBand(diameter, thickness, height){ difference(){ cylinder(d=diameter+thickness,h=height); translate([0,0,-1]) cylinder(d=diameter,h=height+2); } translate([0,0,height]){ rotate_extrude(){ translate([diameter/2+thickness/4, 0, 0]){ scale([1,2,1]){ circle(d = thickness/2); } } } } }
// First example of parameteric model // // syntax: // //Description // variable=value; //Parameter // // This type of comment tells the name of group to which parameters below // this comment will belong // // /*[ group name ]*/ // //Below comment tells the group to which a variable will belong /*[ properties of Sign]*/ //The resolution of the curves. Higher values give smoother curves but may increase the model render time. resolution = 10; //[10, 20, 30, 50, 100] //The horizontal radius of the outer ellipse of the sign. radius = 80;//[60 : 200] //Total height of the sign height = 2;//[1 : 10] /*[ Content To be written ] */ //Message to be write Message = "Welcome to..."; //["Welcome to...", "Happy Birthday!", "Happy Anniversary", "Congratulations", "Thank You"] //Name of Person, company etc. To = "Parametric Designs"; $fn = resolution; rotate([75,0,0]){ scale([1, 0.5]) difference() { cylinder(r = radius, h = 2 * height, center = true); translate([0, 0, height]) cylinder(r = radius - 10, h = height + 1, center = true); } linear_extrude(height = height) { translate([0, --4]) text(Message, halign = "center"); translate([0, -16]) text(To, halign = "center"); } } // Written by Amarjeet Singh Kapoor <amarjeet.kapoor1@gmail.com> // // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to the // public domain worldwide. This software is distributed without any // warranty. // // You should have received a copy of the CC0 Public Domain // Dedication along with this software. // If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
/* [Global] */ // x, y, z dimensions of the cube Vector3=[12,34,45]; /* [Hidden] */ Vector2=[12,34]; /* [Not Used] */ Vector4=[12,34,45,23]; Vector5=[12,34,45,23,56]; VectorRange3=[12,34,46]; //[1:2:50] VectorRange4=[12,34,45,23]; //[1:50] rotate([15,15,15]) cube(Vector3);
Console