2010-07-26 00:57:42 -05:00
|
|
|
/*
|
|
|
|
* Material colors.
|
|
|
|
*
|
|
|
|
* Originally by Hans Häggström, 2010.
|
2010-07-26 01:10:01 -05:00
|
|
|
* Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later
|
2010-07-26 00:57:42 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
// Material colors
|
|
|
|
Oak = [0.65, 0.5, 0.4];
|
|
|
|
Pine = [0.85, 0.7, 0.45];
|
|
|
|
Birch = [0.9, 0.8, 0.6];
|
|
|
|
FiberBoard = [0.7, 0.67, 0.6];
|
|
|
|
BlackPaint = [0.2, 0.2, 0.2];
|
|
|
|
Iron = [0.36, 0.33, 0.33];
|
|
|
|
Steel = [0.65, 0.67, 0.72];
|
|
|
|
Stainless = [0.45, 0.43, 0.5];
|
|
|
|
Aluminum = [0.77, 0.77, 0.8];
|
|
|
|
Brass = [0.88, 0.78, 0.5];
|
2010-07-26 12:56:02 -05:00
|
|
|
Transparent = [1, 1, 1, 0.2];
|
2010-07-26 00:57:42 -05:00
|
|
|
|
|
|
|
// Example, uncomment to view
|
2010-07-26 01:13:34 -05:00
|
|
|
//color_demo();
|
2010-07-26 00:57:42 -05:00
|
|
|
|
2010-07-26 01:13:34 -05:00
|
|
|
module color_demo(){
|
2010-07-26 01:10:01 -05:00
|
|
|
// Wood
|
|
|
|
colorTest(Oak, 0, 0);
|
|
|
|
colorTest(Pine, 1, 0);
|
|
|
|
colorTest(Birch, 2, 0);
|
2010-07-26 00:57:42 -05:00
|
|
|
|
2010-07-26 01:10:01 -05:00
|
|
|
// Metals
|
|
|
|
colorTest(Iron, 0, 1);
|
|
|
|
colorTest(Steel, 1, 1);
|
|
|
|
colorTest(Stainless, 2, 1);
|
|
|
|
colorTest(Aluminum, 3, 1);
|
2010-07-26 00:57:42 -05:00
|
|
|
|
2010-07-26 01:10:01 -05:00
|
|
|
// Mixboards
|
|
|
|
colorTest(FiberBoard, 0, 2);
|
2010-07-26 00:57:42 -05:00
|
|
|
|
2010-07-26 01:10:01 -05:00
|
|
|
// Paints
|
|
|
|
colorTest(BlackPaint, 0, 3);
|
|
|
|
}
|
2010-07-26 00:57:42 -05:00
|
|
|
|
|
|
|
module colorTest(col, row=0, c=0) {
|
|
|
|
color(col) translate([row * 30,c*30,0]) sphere(r=10);
|
|
|
|
}
|