Category Archives: 13-Parametric-Object

Parametric Object – Seashell

I think seashells are a great example of parametric objects in nature, so I was really interested in replicating similar structures in OpenScad.

parametric-object1  parametric-object3

parametric-object2

This algorithm draws a a seashell as a series of cylinders rotating around a center. The algorithm takes as parameters a parameter proportional to the number of cylinders and a parameter for the width of each cylinder.

seashell(10,2);
module seashell(turns, spine) {
	for ( i = [0 : 0.2 : turns] )
	{
		rotate( i * 360/6, [100 * i, i, 0])
		difference () {
			cylinder(h=i, r=i*spine/10, center = true);
			cylinder(h=i/2, r=i*2, center = true);
		}
	}
}

 

Wanfang Diao

23 Jan 2014

DE4EA6FA-98BC-4793-BEA1-80D2E1FD3330
6A159F10-A7C0-4135-9892-831FBF3725C9
In this project I tried to generative spheres as a flower. The first one is radiative and screw shape, the second is use 3 loops to create a flower cluster. I did the second one from make a difference of two sphere as a petal and route them as a flower.I think OpenSCAD is a great tools to do iterative 3D modeling works. It makes maths beautiful. But The second one really ran slow on my mac, it takes long time to render the work, I guess this is the crucial  weakness of the software.

code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!--StartFragment-->module d001()
 
{
 
for(i = [1:1000]) {
 
rotate([360*i/24,360*i/24,360*i/24]) {
 
translate([360*i/24, sin(360*i/6)*80, cos(360*i/6)*80])
 
sphere(600,600,600);}
 
}
 
}
 
d001();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
module d002()
 
{
 for(k = [1:10]) {
			   rotate([0,360*k/6,0])
			   union(){
			   for(i = [1:10]) {
 
							 rotate([0,0,360*i/6])
                 				 translate([0,240,240])
							 scale([3,3,3])
							 union()
						       {
 							    for(j = [1:10])
  				 				  {
 //translate([360*i/24, sin(360*i/6)*80, cos(360*i/6)*80])
								   rotate([0,360*j/6,0])
								   union()
								    {
								     difference(){
									color("Plum")
								     sphere(50,50,50); 
								     translate([0,20,30])
								     sphere(70,70,70);
								     }
    								   }
  	 			 	              }
				               }	
				             }
		             }
	          }
 
} 
d002();

		

Haris Usmani

23 Jan 2014

Goals: Interesting, Useful

A customizable OpenSCAD “Universal Rack-Clamp” by @uzmani90- let’s you make a variety of structures, cost-effectively.

This summer while designing a DIY Electronic Drum-kit, I noticed that there existed no open 3-D CAD model of a Universal Rack-Clamp. So what is a Universal Rack-Clamp? It’s the clamp used to put together pipe structures such as a working Rig (the ones used on construction sites) as well as Drum Rigs (the ones used to customize and hold Toms, Cow Bells etc.). I made one using Autodesk Inventor for my project, but I think now is the time I make one using OpenSCAD which can be customized to different pipe and wing-nut/screw specifications.

This clamp can be used to make anything that requires joining pipes (PVC, Metal, PPRC) with the constraint that the two pipes remain perpendicular to each other. It allows a variety of structures to be constructed, which are adjustable in dimensions due to the wing-nut/screws.

G-clamp
Image from http://www.musiciansfriend.com/drums-percussion

roland_td30k
A Roland TD 30-K constructed using these Rack-Clamps.

Here’s a version I made on Inventor in Summer 2013- we customized it for 3-D printing with ABS, modifying it for strength. With replacements rack-clamps running at ~$25 each, printing it is actually cheaper! (you can get a whole ABS spool for that and print at least 3 of these for 1-1/2 inch Schedule 40 PVC pipe)- plus you can customize it to your exact specifications.

rig_clamp
This clamp is practical enough to print and use. I kept one side flat as a 3-D printing base. All pipe and nut dimensions are accurate and were taken from the following documents:

Metric Hex-Nut Dimensions: http://www.fairburyfastener.com/xdims_metric_nuts.htm
PVC Pipe Dimensions: http://www.harvel.com/piping-systems/harvel-pvc-pipe/schedule-40-80/dimensions

AutoSCAD Version:
Customize it at: http://www.thingiverse.com/thing:232920


1 2 3 4

Variables you can customize:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//M. Haris Usmani
//http://harisusmani.com
 
//All Units are in mm, Import as STL with Unit=mm
 
/* [Main Settings] */
//Radius of Pipe in Inches (Schedule 40)
R=1.9; //[2.375:2"PVC,1.9:1-1/2"PVC,1.660:1-1/4"PVC,1.315:1"PVC]
 
//Space for Tightening
T=3; //[0:5]
 
//Nut Size
M=5; //[4,5,6]
 
/////////////////////////////////////////////////////////////////////////////
R_mm=R*25.4; //Converted to mm!
//Strength of Clamp (Fixed)
S=1.2; // [1.2] Determines Strength of Clamp in Percentage-FIXED!
 
/////////////////////////////////////////////////////////////////////////////
//Hexagonal Module from shapes.scad, http://svn.clifford.at/openscad/trunk/libraries/shapes.scad by Catarina Mota
module hexagon(size, height) {
  boxWidth = size/1.75;
  for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);
}
/////////////////////////////////////////////////////////////////////////////
 
//Pipe Model for Visualization
//translate([R_mm*S/2,R_mm*S/2,-R_mm*6]) cylinder(R_mm*10,R_mm/2,R_mm/2);
 
union()//Main Duplication
{
 
difference() //Pipe Hole
{
union()
{
minkowski() //Fillet
{
	union()
	{
		cube([R_mm*S,R_mm/2*S, R_mm*S]); //Main Body
		translate([R_mm*S/2,R_mm*S/2,0]) cylinder(R_mm*S,R_mm*S/2,R_mm*S/2); //Curved Edge
	}
	sphere([R_mm/2,R_mm,R_mm*5/12]); //Fillet Object
}
 
minkowski() //Fillet
{
	difference() //Hard Chamfer
	{
		translate([-R_mm/4,R_mm/5,(R_mm/2)-(R_mm*5/48)]) cube([R_mm/2,R_mm/1.4,R_mm*5/12]);
		translate([-R_mm,-R_mm*7/17,(R_mm/2)-(R_mm*5/24)]) rotate([0,0,-33]) cube([R_mm/2,R_mm,2*R_mm*5/12]);
	}
	sphere([R_mm/2,R_mm,R_mm*5/12]); //Fillet Object
}
}
	union()
	{
		translate([R_mm*S/2,R_mm*S/2,-R_mm*6]) cylinder(R_mm*10,R_mm/2,R_mm/2);//Pipe
		translate([-R_mm,R_mm*S*5/12,-R_mm]) cube([R_mm*2,R_mm/(15-T),R_mm*4]);//Tightning Space
		translate([-R_mm/7,R_mm*2,(R_mm*S/2)]) rotate([90,0,0]) cylinder((R_mm*4),M/2,M/2); //Screw Space
		if (M==4) translate([-R_mm/7,-R_mm*0.2,(R_mm*S/2)]) rotate([90,0,0]) hexagon(7.66,50); //NUTS
		if (M==5) translate([-R_mm/7,-R_mm*0.2,(R_mm*S/2)]) rotate([90,0,0]) hexagon(8.79,50);
		if (M==6) translate([-R_mm/7,-R_mm*0.2,(R_mm*S/2)]) rotate([90,0,0]) hexagon(11.05,50);
	}
} //Single Side ENDS
 
}
 
{
 
translate([R_mm*S,1,R_mm*S]) rotate([180,90,0]) //Main Translation
 
//COPY SIDE HERE
difference() //Pipe Hole
{
union()
{
minkowski() //Fillet
{
	union()
	{
		cube([R_mm*S,R_mm/2*S, R_mm*S]); //Main Body
		translate([R_mm*S/2,R_mm*S/2,0]) cylinder(R_mm*S,R_mm*S/2,R_mm*S/2); //Curved Edge
	}
	sphere([R_mm/2,R_mm,R_mm*5/12]); //Fillet Object
}
 
minkowski() //Fillet
{
	difference() //Hard Chamfer
	{
		translate([-R_mm/4,R_mm/5,(R_mm/2)-(R_mm*5/48)]) cube([R_mm/2,R_mm/1.4,R_mm*5/12]);
		translate([-R_mm,-R_mm*7/17,(R_mm/2)-(R_mm*5/24)]) rotate([0,0,-33]) cube([R_mm/2,R_mm,2*R_mm*5/12]);
	}
	sphere([R_mm/2,R_mm,R_mm*5/12]); //Fillet Object
}
}
	union()
	{
		translate([R_mm*S/2,R_mm*S/2,-R_mm*6]) cylinder(R_mm*10,R_mm/2,R_mm/2);//Pipe
		translate([-R_mm,R_mm*S*5/12,-R_mm]) cube([R_mm*2,R_mm/(15-T),R_mm*4]);//Tightning Space
		translate([-R_mm/7,R_mm*2,(R_mm*S/2)]) rotate([90,0,0]) cylinder((R_mm*4),M/2,M/2); //Screw Space
		if (M==4) translate([-R_mm/7,-R_mm*0.2,(R_mm*S/2)]) rotate([90,0,0]) hexagon(7.66,50); //NUTS
		if (M==5) translate([-R_mm/7,-R_mm*0.2,(R_mm*S/2)]) rotate([90,0,0]) hexagon(8.79,50);
		if (M==6) translate([-R_mm/7,-R_mm*0.2,(R_mm*S/2)]) rotate([90,0,0]) hexagon(11.05,50);
	}
}
///////////////
}
 
//preview[view: north, tilt: top];

Collin Burger

23 Jan 2014

First of all, I consider this very much a work in progress.

MonoJan19_2
January 19, 2014


MonoJan20_2
January 20, 2014

My parametric object is a monument that attempts to stand as a testament to my ability to be productive. The object is part information visualization and part performance, representing my focus on work as time passes.  Using data from the application and service RescueTime, I was able to ascertain how much time I spent doing productive activity on my laptop and how much time I was being unproductive.  For each hour, a layer is made, with its height, skew from the center, and size determined by data such as time spent on the laptop and how much of that time was productive or spent on distractions.  I was hoping to create objects that were both interesting and beautiful, however lots of work needs to be done to reach that goal.

Notes:
para_1
para_2
para_3

Shan Huang

23 Jan 2014

Carnegie Castles by @yemount. CMU buildings just stopped being boring.

carnegie-castles-3

Out of a hundred awesome things about Game of Thrones TV series’ epic opening, I am the most impressed by the beautiful castle models made for Westeros’ cities. When searching for inspirations for the parametric object project, I came across this Winterfell model by damm301 and I instantly knew I wanted to build parametric medieval cities.

I’ve had the idea of reading building information from map engine APIs for a while, so I thought it would be fun if I could build castles off existing maps. In particular I was interested in transforming CMU buildings into something cooler and less predictable than their current circumstances. I attempted to use both Google Map Javascript API and Google Map Engine API but either of them allowed me to fetch raw map data like building/street geometries. After some painful search I finally arrived at OpenStreetMap, an awesome project that maintains editable maps of the world. There’s less guarantee on the quality of the maps as they are collaborative edited by the crowd, but I found it satisfactory enough, at least for neighborhoods of CMU.

CMUmap

I queried the CMU region and parsed the returned map data. Buildings and streets were exported to a file as polygons and vertices in openSCAD syntax. I had to copy and paste lots of stuff into my openSCAD file every time I regenerated my buildings, and as a result my openSCAD code looked shitty. But it got stuff done, so whatever…

carnegie-castles-4

carnegie-castles-5

Top-down view of my generated Carnegie castles. Hopefully you can identify some familiar buildings like Morewood and UC.

carnegie-castles-1

Castles in construction.

Sketches

sketches

Code

I’ve come to realize that openSCAD does not have a runtime environment and therefore does not have real variables. As a result, I had to paste raw data into the openSCAD file to make the thing compile, which makes the code lengthy and ugly. I don’t want to damage your eyes with my supper inelegant code, so I’ll provide the github link here instead of pasting code.

https://github.com/yemount/ParametricObject.git

MacKenzie Bates

23 Jan 2014

Name_View

Tweeter Post:

Customizable locks that would look great attached to your most romantic local bridge this Valentines Day! Locks can’t be reopened  so no worries of keys or combos ruining the moment!

Description:

img_3758-4

Lock Bridges have been a growing worldwide trend for the last decade. Those in love go to the bridges together with a lock and attach it to the bridge to signify their bond. Typically couples write their information with black sharpies onto the locks. I have seen the lock bridge in Paris and my girlfriend and I have a lock on the Phipps bridge in Pittsburgh.

One sad thing you notice when you walk past one of these lock bridges is that the sharpie has warn off most of the locks. A proud few have engraved locks and avoid these troubles. With Valentines Day approaching and lost for ideas of what parametric object to make. I decided to make a customizable lock, so that anyone with a 3D printer could have a customized lock that would withstand the outdoors better.

Due to my lack of experience with making locks, I made the lock design be unopenable once closed the first time (when you put the lock on the bridge, you can’t open it, which is actually the point of it so it worked out well). I have not gotten to test the lock because I don’t have a 3D printer, but I believe it should be functional and if not, would just require minor tweaking. I didn’t appreciate the pain of constructing a lock until now.

Top_View

The Inner working of the lock

Example Variations:

Name_View_f2

Name_View_f3

GitHub Link

Thingiverse Link

Sketches:

WP_20140123_001 WP_20140123_002 WP_20140123_003

Code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
use 
 
module body()
{
	scale = 5;
	fontSize = scale * 3;
	fontWidth = scale;
	levelScale = .35;
	width = .7;
 
	union()	{
	difference() {
		difference() {
			cube([scale*25,scale*10,scale*20], true);
			translate([0, 0,scale*0]) cube([scale*23,scale*8,scale*18], true);
			//cylinder(r = scale*levelScale, h = width*scale);
		}
		union()	{
			translate([-3*scale, 0,scale*9]) cylinder(r = scale*2+2, h = scale);
			//translate([-7*scale, 0,scale*9]) cylinder(r = scale*2+2, h = scale);
			translate([7*scale, 0,scale*9]) cylinder(r = scale+2, h = scale);
		}
	}
		union() {
			union()	{
				translate([-6*scale, 5*scale,scale*8]) rotate([90,0,0]) cylinder(r = scale*levelScale, h = 10*scale);
				translate([0*scale, 5*scale,scale*8]) rotate([90,0,0]) cylinder(r = scale*levelScale, h = 10*scale);
			}
		}
	}
 
			translate([scale*.2, scale*-5,scale*7]) rotate([90,0,0])
			{write("MacKenzie",t=fontWidth,h=fontSize,center=true, font = "orbitron.dxf");}
 
			translate([scale*.2, scale*-5,scale*3]) rotate([90,0,0])
			{write("and",t=fontWidth,h=fontSize,center=true, font = "orbitron.dxf");}
 
			translate([scale*.2, scale*-5,scale*-1]) rotate([90,0,0])
			{write("Abby",t=fontWidth,h=fontSize,center=true, font = "orbitron.dxf");}
 
			translate([scale*.2, scale*-5,scale*-6.5]) rotate([90,0,0])
			{write("11/26/11",t=fontWidth,h=fontSize,center=true, font = "orbitron.dxf");}		
}
 
module pin()
{
	scale = 5;
	n = 18;
	d = 180/n;
	ph = 20;
	iph = .85;
 
	translate([scale*2, 0,scale*20]) rotate([0,-90,270]) union() {
	//translate([scale*0, 0,scale*20]) rotate([0,-90,270]) union() {
		for (i = [1:n])
		{
			translate([sin(i*d) * 5 * scale, cos(i*d) * 5 * scale, 0])
			//translate([sin(i*d) * 5 * scale, cos(i*d) * 7 * scale, 0])
			{
				sphere(scale);
			}
		}
		rotate([0,270,0]) {
			translate([0,5*scale,0]) {
				sphere(scale);
				cylinder(r = scale, h = ph*scale);
			}
			translate([0,5*scale,(ph-.5)*scale]) {
				cube([scale*3,5*scale,3*scale], true);
			}
 
			translate([0,-5*scale,0]) {
				sphere(scale);
				cylinder(r = scale, h = (ph*iph)*scale);
			}
			translate([0,-5*scale,((ph * iph) -.5)*scale]) {
				cube([scale*2,4*scale,3*scale], true);
			}
		}
	}
}
 
module lever()
{
	scale = 10;
	levelScale = .35;
	width = .7;
 
	rotate([90,0,0]) translate([scale*-3,scale*4, scale*-.25]) union() {
		difference() {
			cylinder(r = scale*levelScale*2, h = width*scale);
			cylinder(r = scale*levelScale, h = width*scale);
		}
		translate([width*scale*1.5,0,width*scale*.5])cube([width*scale*2,width*scale,width*scale], true);
	}
 
	rotate([90,0,0]) translate([scale*0,scale*4, scale*.25]) rotate([0,180,0]) union() {
		difference() {
			cylinder(r = scale*levelScale*2, h = width*scale);
			cylinder(r = scale*levelScale, h = width*scale);
		}
		translate([width*scale*1.5,0,width*scale*.5])cube([width*scale*2,width*scale,width*scale], true);
	}
}
 
lever();
 
pin();
 
body();

Ticha Sethapakdi

23 Jan 2014

Glasses for the Masses by @creativethumbs is a fully customizable pair of glasses made with OpenScad.

Here’s the thing.

glasses4

glasses5

glasses1

glasses2

 

Essentially it’s a program that allows the user to specify the parameters of a pair of glasses–such as height, width, roundness, and lens tint–and creates a model of the pair of glasses with the desired specifications. I would like to think that people find this project beautiful and useful.

This project was not inspired by anything in particular; it was more of a personal experiment because I am incredibly picky about the things I wear / what I put on my body. Because of that, when I have to go shopping for articles such as glasses I often leave the store empty-handed because I am not satisfied with their selections. Sometimes I would feel that an aspect of a certain design fits better with that of another, but there is no design that meets my expectations. Alternatively, I would find a pair of glasses that look exactly the way I want them to, but end up not fitting well. I was hoping to use this program as a way to address this conflict between consumer desires and product availability, and I also was interested in creating something that was practical as well as aesthetic. The program works mostly the way I wanted it to–it has a lot of variables that the user can change and the glasses actually look like glasses. While changing the parameters in the code can give very varied and interesting results, the program still has a fair share of errors (such as scaling issues and proportions) that I would need to fix if I wanted to put it to use. With regard to that, I would have to add details, such as leg joints, to the model if it needed to be used as reference for an actual physical object.

One of the many challenges of this project was getting the lens to scale properly when the ’roundedness’ value changed. Because the square lens are constructed using a minkowski transformation, greater ’roundedness’ values mean larger cylinders are being wrapped around the quadrangle–which means the lens after the transformation will become larger than the rectangle they were formed by. Even after hours of scratching my head, I was not able to derive a mathematical relationship between the size of the lens before and after the minkowski transformation–I ended up using an arbitrary inverse-square-root equation that seemed to work well for smaller inputs.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
 
/* Parametric glasses by Ticha Sethapakdi */
 
//----USER DEFINED VARIABLES-----
 
//the style of the glasses can either be 'squared' or 'oval'
frame = "oval";
//value from 1-6; can technically be larger, but some parts may look awkward...
roundedness = 6;
 
//1 for regular glasses; 2 for sunglasses
style = 2;
 
width = 10;
height = 5;
length = 14;
 
//for "oval" mode only:
radius = 7;
 
//see the SVG color list (http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#color) 
//for all possible color selections
//e.g. Crimson, Coral, Fuchsia, Chocolate, Navy...
frame_color = "Crimson";
 
//if the style is "sunglasses", the user may customize the color of the lens
//again, consult the SVG color list for a range of selections
lens_color = "Aqua";
 
 
//-------------------------------
 
/* The glasses are created here */
eyegap = 5;
 
if(frame == "squared") {
	rotate([90,0,0]) {
		translate([sqrt(roundedness), -sqrt(roundedness), 0]){
		scale([1/sqrt(roundedness), 1/sqrt(roundedness), 0.5]){
		translate([width/2+eyegap/2-1.5/roundedness, 0,0]) {
			//draws one side of the frame
			color(frame_color) {
				difference() { 
					minkowski() {
						hull() {
							cube([width, 1, 1], center = true);
							translate([0,-height+1,0]){cube([3*width/4, 3*height/4, 1], center = true);}
						}
						cylinder(r=roundedness, h=1);
					}
 
					translate([0,-0.8,0]){ scale([0.8,0.8,2]){
					minkowski() {
						hull() {
							cube([width, 1, 1], center = true);
							translate([0,-height+1,0]){cube([3*width/4, 3*height/4, 1], center = true);}
						}
						cylinder(r=roundedness, h=1);
					}}}
				}
 
			}
 
			//draws the lens
			if(style == 2) {
				color(lens_color, 0.7) {
					translate([0,-0.8,0]){ scale([0.8,0.8,0.5]){
					minkowski() {
						hull() {
							cube([width, 1, 1], center = true);
							translate([0,-height+1,0]){cube([3*width/4, 3*height/4, 1], center = true);}
						}
						cylinder(r=roundedness, h=1);
					}}}
				}
			}
 
			else {
				color("white", 0.4) {
					translate([0,-0.8,0]){ scale([0.8,0.8,0.5]){
					minkowski() {
						hull() {
							cube([width, 1, 1], center = true);
							translate([0,-height+1,0]){cube([3*width/4, 3*height/4, 1], center = true);}
						}
						cylinder(r=roundedness, h=1);
					}}}
				}
			}
 
			//leg
			color(frame_color) {
				hull() {
					translate([width/2 + roundedness, (height/2)*0.6-2,-1.5]){ 
						cube([1, 2.5, 5], center = true);  	
					}
 
					translate([width/2 + roundedness, (height/2)*0.6-2,-23.5]){ 
						cube([1, 1.5, 3], center = true);
					}
 
				}
				hull() {
					translate([width/2 + roundedness, (height/2)*0.6-2,-24.5]){ 
						cube([1, 1.5, 1.5], center = true);
					}
					translate([width/2 + roundedness, (height/2)*0.6-5,-32.5]){ 
								cube([1, 1.5, 1.5], center = true);
					}
				}
			}
 
		}}}
 
		//bridge
		color(frame_color) {
 
			hull() {
				translate([0.25, -1.8, 0.25]){ 
						cube([0.5, 1, 1], center = true);
				}
				translate([eyegap/3, -1.8, 0.25]){ 
						cube([0.2, 1.5, 1], center = true);
				}
			}
		}
	}
 
	mirror([1,0,0]) {rotate([90,0,0]) {
		translate([sqrt(roundedness), -sqrt(roundedness), 0]){
		scale([1/sqrt(roundedness), 1/sqrt(roundedness), 0.5]){
		translate([width/2+eyegap/2-1.5/roundedness, 0,0]) {
			//draws one side of the frame
			color(frame_color) {
				difference() { 
					minkowski() {
						hull() {
							cube([width, 1, 1], center = true);
							translate([0,-height+1,0]){cube([3*width/4, 3*height/4, 1], center = true);}
						}
						cylinder(r=roundedness, h=1);
					}
					translate([0,-0.8,0]){ scale([0.8,0.8,2]){
					minkowski() {
						hull() {
							cube([width, 1, 1], center = true);
							translate([0,-height+1,0]){cube([3*width/4, 3*height/4, 1], center = true);}
						}
						cylinder(r=roundedness, h=1);
					}}}
				}
 
			}
 
			//draws the lens
			if(style == 2) {
				color(lens_color, 0.7) {
					translate([0,-0.8,0]){ scale([0.8,0.8,0.5]){
					minkowski() {
						hull() {
							cube([width, 1, 1], center = true);
							translate([0,-height+1,0]){cube([3*width/4, 3*height/4, 1], center = true);}
						}
						cylinder(r=roundedness, h=1);
					}}}
				}
			}
 
			else {
				color("white", 0.4) {
					translate([0,-0.8,0]){ scale([0.8,0.8,0.5]){
					minkowski() {
						hull() {
							cube([width, 1, 1], center = true);
							translate([0,-height+1,0]){cube([3*width/4, 3*height/4, 1], center = true);}
						}
						cylinder(r=roundedness, h=1);
					}}}
				}
			}
 
			//leg
			color(frame_color) {
				hull() {
					translate([width/2 + roundedness, (height/2)*0.6-2,-1.5]){ 
						cube([1, 2.5, 5], center = true);  	
					}
 
					translate([width/2 + roundedness, (height/2)*0.6-2,-23.5]){ 
						cube([1, 1.5, 3], center = true);
					}
 
				}
				hull() {
					translate([width/2 + roundedness, (height/2)*0.6-2,-24.5]){ 
						cube([1, 1.5, 1.5], center = true);
					}
					translate([width/2 + roundedness, (height/2)*0.6-5,-32.5]){ 
								cube([1, 1.5, 1.5], center = true);
					}
				}
			}
 
		}}}
 
		//bridge
		color(frame_color) {
 
			hull() {
				translate([0.25, -1.8, 0.25]){ 
						cube([0.5, 1, 1], center = true);
				}
				translate([eyegap/3, -1.8, 0.25]){ 
						cube([0.2, 1.5, 1], center = true);
				}
			}
		}
	}}
 
}
 
 
//ROUNDED FRAME
else if (frame == "oval") {
	rotate([90,0,0]) {
		translate([6.5*radius/8+eyegap/2, 0,0]) {
			//draws one side of the frame
			color(frame_color) {
				difference() { 
					cylinder(1,radius,radius, center = true);
 
					scale([0.8,0.8,2]){
						cylinder(1,radius,radius, center = true);
					}				
 
				}
 
			}
 
			//draws the lens
			if(style == 2) {
				color(lens_color, 0.7) {
					scale([0.8,0.8,0.5]){
						cylinder(1,radius,radius, center = true);
					}	
				}
			}
 
			else {
				color("white", 0.4) {
					scale([0.8,0.8,0.5]){
						cylinder(1,radius,radius, center = true);
					}	
				}
 
			}
 
			//leg
			color(frame_color) {
				hull() {
					translate([radius, 0, -2]){ 
						cube([1, 2.5, 5], center = true);  	
					}
 
					translate([radius, 0,-23.5]){ 
						cube([1, 1.5, 3], center = true);
					}
 
				}
				hull() {
					translate([radius, 0 ,-24.5]){ 
						cube([1, 1.5, 1.5], center = true);
					}
					translate([radius, -2,-32.5]){ 
								cube([1, 1.5, 1.5], center = true);
					}
				}
			}
 
		}
 
		//bridge
		color(frame_color) {
 
			hull() {
				translate([0.25, 1.5, 0]){ 
						cube([0.5, 1, 1], center = true);
				}
				translate([eyegap/3, 1.5, 0]){ 
						cube([0.2, 1.5, 1], center = true);
				}
			}
		}
	}
 
	mirror([1,0,0]) {rotate([90,0,0]) {
		translate([6.5*radius/8+eyegap/2, 0,0]) {
			//draws one side of the frame
			color(frame_color) {
				difference() { 
					cylinder(1,radius,radius, center = true);
 
					scale([0.8,0.8,2]){
						cylinder(1,radius,radius, center = true);
					}				
 
				}
 
			}
 
			//draws the lens
			if(style == 2) {
				color(lens_color, 0.7) {
					scale([0.8,0.8,0.5]){
						cylinder(1,radius,radius, center = true);
					}	
				}
			}
 
			else {
				color("white", 0.4) {
					scale([0.8,0.8,0.5]){
						cylinder(1,radius,radius, center = true);
					}	
				}
 
			}
 
			//leg
			color(frame_color) {
				hull() {
					translate([radius, 0, -2]){ 
						cube([1, 2.5, 5], center = true);  	
					}
 
					translate([radius, 0,-23.5]){ 
						cube([1, 1.5, 3], center = true);
					}
 
				}
				hull() {
					translate([radius, 0 ,-24.5]){ 
						cube([1, 1.5, 1.5], center = true);
					}
					translate([radius, -2,-32.5]){ 
								cube([1, 1.5, 1.5], center = true);
					}
				}
			}
 
		}
 
		//bridge
		color(frame_color) {
 
			hull() {
				translate([0.25, 1.5, 0]){ 
						cube([0.5, 1, 1], center = true);
				}
				translate([eyegap/3, 1.5, 0]){ 
						cube([0.2, 1.5, 1], center = true);
				}
			}
		}
	}}
 
 
}
 
else {
	echo("Undefined frame style!");
}

Yingri Guan

23 Jan 2014

I am always fascinated by the complexity of fractals. I was inspired to create a 3D fractal. However, the design came out to be a little disappointment as I wished to have more intricate structures in the design.

 

7521

image

 

This parametric design made reference to the design by Espen Skjervold.
Code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
//Referenced Espen Skjervold's work 2013
 
 
 
//constants
maxX=20;			//< -- less important, size of the biggest object
sizeFactor=2.3;   //<-- The size factor between an object and its child objects. The smaller the factor, the larger the children will be. 
 
 
fractal(4); // <--- render the fractal with n number of levels
 
 
 
//Recursive method
module fractal(levels, i=1, xPos=0, yPos=0, zPos=0) {			
 
	currentFactor=pow(sizeFactor,i);
	x=maxX/currentFactor;
 
 
	if (i<=levels) {
 
 
		//top	
		fractal(levels, i+1, xPos , yPos , zPos);
		fractal(levels, i+1, xPos , yPos , zPos);
		fractal(levels, i+1, xPos*2 , yPos*2 , zPos*0.5);
		fractal(levels, i+1, xPos*0.7 , yPos*0.5 , zPos*0.4 );
		fractal(levels, i+1, xPos +x/2, yPos + x/2, zPos + x/2);
		fractal(levels, i+1, xPos -x/2, yPos + x/2, zPos + x/2);
		fractal(levels, i+1, xPos +x/2, yPos - x/2, zPos + x/2);
		fractal(levels, i+1, xPos -x/2, yPos - x/2, zPos + x/2);
 
		//bottom	
		fractal(levels, i+1, xPos , -yPos , -zPos );
		fractal(levels, i+1, xPos , yPos , -zPos );
		fractal(levels, i+1, xPos*3 , yPos*3 , -zPos*3 );
		fractal(levels, i+1, xPos*0.2 , yPos*0.4 , -zPos*0.5 );
		fractal(levels, i+1, xPos*1.3 , yPos*1.5 , -zPos*2 );
		fractal(levels, i+1, xPos*0.7 , yPos*0.5 , -zPos*0.4 );
		fractal(levels, i+1, xPos +x/2, yPos + x/2, -zPos - x/2);
		fractal(levels, i+1, xPos -x/2, yPos + x/2, -zPos - x/2);
		fractal(levels, i+1, xPos +x/2, yPos - x/2, -zPos - x/2);
		fractal(levels, i+1, xPos -x/2, yPos - x/2, -zPos - x/2);
 
 
		makeCube(x, xPos, yPos, zPos, i);
	}
 
 
 
}
 
 
//The actual rendering of each object
module makeCube(x, xPos, yPos, zPos, level) {
 
	union() {
 
		translate([xPos+x/2, yPos, zPos]) 
			color(["Coral"]) 
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos-x/2, yPos, zPos]) 
			color(["Coral"]) 
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos, yPos+x/2, zPos]) 
			color(["Coral"])  
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos, yPos-x/2, zPos]) 
			color(["Coral"])  
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos, yPos, zPos+x/2])
			color(["Coral"])    
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos, yPos, zPos-x/2])
			color(["Coral"])   
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos, yPos*0.5, -zPos]) 
			color(["Coral"])  
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos, yPos*0.5, zPos]) 
			color(["Coral"])  
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos, yPos, -zPos*0.5]) 
			color(["Coral"])  
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos, yPos, zPos*0.5]) 
			color(["Coral"])  
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos*0.5, yPos, -zPos]) 
			color(["Coral"])   
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos*0.5, yPos, zPos]) 
			color(["Coral"]) 
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos*0.5, yPos*0.5, -zPos]) 
			color(["Coral"])   
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos*0.5, yPos*0.5, zPos]) 
			color(["Coral"])   
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos*2, yPos*2, -zPos])
			color(["Coral"])   
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos*2, yPos*2, zPos])
			color(["Coral"])     
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos, yPos*2, -zPos*2])
			color(["Coral"])    
			cube((x)/1.4, center=true, $fn=10 );
 
		translate([xPos, yPos*2, zPos*2]) 
			color(["Coral"])   
			cube((x)/1.4, center=true, $fn=10 );
 
	}		
}

Kevan Loney

23 Jan 2014

Parametric Pancakes by @kdloney is generative pancake code. Allowing for the perfect custom pancake platter every time using #OpenSCAD.

Pancake_Finale_Loney

Parametric Pancakes started out as simple dream from a grad student that loves a good simple breakfast. It came from the whimsical idea that one day we can live in a world that can use code to print food for us in the event that one may not have time (nor trust themselves with a stove top). This project consist of the “beauty” of fluffy pancakes, while being very “useful” to a on-the-go sleep deprived grad student. Although it may seem a bit intimidating at first glance to use code for food, once started, a whole new world can open up for the hungry tummy of every “Sussie Sue” or “John Smith” MFA candidate. Thus, this project could one day cure the epidemic that is grad student mid day or night hunger pains.

Future plans could include dynamic butter/syrup layout generators, so that you can have fun with your food’s overall attractiveness, while at the same time making other’s mouths water in complete envy.

OpenSCAD_Pancakes_Loney_Model
Raw Mesh goodness
Sketch
Sketch

 

Only a tad bit of syrup on top applies to your taste? Go get 'em Grad! Take on the day!
Only a tad bit of syrup on top applies to your taste? Go get ’em Grad! Take on the day!
More Pancakes, no topping Syrup? No Problem!
More Pancakes, no topping Syrup? No Problem!

You can find this code below, or at my GitHub repository:

https://github.com/kdloney/OpenSCAD_Pancakes 

Find it on Thingiverse:

http://www.thingiverse.com/thing:232372

Code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
difference(){
 
union() {
 
	color("GhostWhite")
	cylinder (h = .2, r= 1.8, center = true, $fn=100);
	color("GhostWhite")
	translate (0, 1.2, 0) cylinder (h = .1, r = 2, $fn=100);
 
}
 
color("LightGrey")
translate (0, 1.5, 0) cylinder (h = .3, r = 1.7,$fn=100);
}
 
pancake(height= .1, width =.2);
 
butter();
syrup();
translate ([.9, 0, -1.15])
scale([2, -1.5, 1])
syrup();
 
module batter() {
	minkowski(){
	cylinder(h = .1, r = 1, $fn=100);
    sphere( r =.1,  $fn=10);
}
}
 
module pancake(height, width){
	color("Sienna")
	translate ([0, 0, height]) batter();
	color("Sienna")
	translate ([width, 0, height*3.7]) batter();
	color("Sienna")
	translate ([0, 0, height*6.5]) batter();
	color("Peru")
	translate ([width-.5, 0, height*9.5]) batter();
 
}
 
module butter(){
intersection(){
	translate([-.5,-.5,1.15])
	scale([.6,.5, .1])
     cube([.5]);
}
}
 
module syrup(){
	color("SaddleBrown")
	scale([.5,.5,1])
	translate([-1,-.8,0])
	hull() {
   	translate([1,0,1.15]) cylinder(r= .6, h = .03,$fn=100);
   	translate([1,1.5,1.15]) cylinder(r= .2, h = .03,$fn=100);
	translate([-1,1,1.15]) cylinder(r= .5, h = .03,$fn=100);
	translate([0,1,1.15]) cylinder(r= .8, h = .03,$fn=100);
	translate([0,2,1.15]) cylinder(r= .8, h = .03,$fn=100);
 }
}
 
}

 For Fun:

The public loves the idea of virtual butter. Virtual Butter = No empty calories!

Twitter public response.
Twitter public response.

Andre Le

23 Jan 2014

 

 

BuildingBuilder by @Andre_Le. An #OpenSCAD project that procedurally creates a 3D building model.

andrele_building_generator

 

frame00002
frame00000

This project was built with the intention of it being a springboard for entire procedurally generated cities. This was my first foray into anything 3D and wrapping my head around 3D coordinates and transforms using algorithms was a little tricky at first, so I opted to keep this project relatively simple. All of the properties of the building has been parameterized, so height, width, depth, number of windows in a row, and even spacing between windows can be changed.

Thingiverse

Github Link

// OpenSCAD Building Generator
// Written by Andre Le
// for Golan Levin's Interactive Art and Computational Design 2014
 
height = 900;
width = 10000*sin($t)+1000;
depth = 10000*sin($t)+1000;
gutter = .2;
floorHeight = 10;
windowColumns = 10;
windowSize = width*(1-gutter)/windowColumns;
tHeight = height*($t+1);
 
// Determine how many floors fit
floors = floor(tHeight / ((windowSize)+(gutter*width/(windowColumns+1))));
 
translate([-width/2,-depth/2,0]){
	difference(){
		cube([width,depth,tHeight]);
 
		// Create floors
		for(j = [0:floors-1]) {
 
			translate([0,0,j*(windowSize)+((j +1)*(gutter*width/(windowColumns+1)))]){
				// Create row of windows along width
				for(i = [0:windowColumns-1]) {
					translate([i*(windowSize)+((i+1)*(gutter*width/(windowColumns+1))),-1,(gutter*width/windowColumns)]){
						cube([windowSize,15,windowSize]);
					}
				}
				translate([0,depth-13,0]){
					for(i = [0:windowColumns-1]) {
						translate([i*(windowSize)+((i+1)*(gutter*width/(windowColumns+1))),-1,(gutter*width/windowColumns)]){
							cube([windowSize,15,windowSize]);
						}
					}
				}
				// Create row of windows long depth
				rotate([0,0,90]){
					translate([0,-13,0]){
						for(f = [0:windowColumns-1]) {
							translate([f*(depth*(1-gutter)/windowColumns)+((f+1)*(gutter*depth/(windowColumns+1))),-1,(gutter*width/windowColumns)]){
								cube([depth*(1-gutter)/windowColumns,15,windowSize]);
							}
 
						}
						translate([0,-width+13,0]){
							for(f = [0:windowColumns-1]) {
								translate([f*(depth*(1-gutter)/windowColumns)+((f+1)*(gutter*depth/(windowColumns+1))),-1,(gutter*width/windowColumns)]){
									cube([depth*(1-gutter)/windowColumns,15,windowSize]);
								}
 
							}
						}
					}
				}
			}
		}
	}
}

IMG_1065