HexaCone/hexabenz.inc

100 lines
1.8 KiB
PHP
Raw Normal View History

2025-01-05 04:56:37 +11:00
/*
* H E X A C O N E
*/
// =======================================================
#declare Benz_Cone_Base = object
{
2025-01-07 02:05:57 +11:00
#local RA = 0.120;
2025-01-05 04:56:37 +11:00
#local RB = 0.001;
union {
cone { 0, RA, y, RB }
2025-01-07 02:05:57 +11:00
sphere { 0, RA*1.098 scale <1, 0.62, 3.2> translate -0.02*y }
2025-01-05 04:56:37 +11:00
}
}
2025-01-07 02:05:57 +11:00
#macro Benz_Cones () // = object
// {
2025-01-05 04:56:37 +11:00
union {
#for (foo, 0, 360, 60)
2025-01-05 10:18:06 +11:00
#local E = 0.40;
2025-01-05 04:56:37 +11:00
#local Tx = E * sin(radians(foo));
#local Ty = E * cos(radians(foo));
object { Benz_Cone_Base
2025-01-07 02:05:57 +11:00
#if ( rand(Rng1) < 0.5 )
texture { Soft_Silver scale 16.50 }
#else
texture { T_Brass_2C scale 13.50 }
#end
2025-01-05 04:56:37 +11:00
rotate -z*foo
translate <Tx, Ty, 0>
}
#end
}
2025-01-07 02:05:57 +11:00
// }
#end
2025-01-05 04:56:37 +11:00
// ------------------------------------------------------
2025-01-05 10:18:06 +11:00
#local RT = 0.24;
2025-01-07 02:05:57 +11:00
#local LT = 0.61;
2025-01-05 10:18:06 +11:00
#declare Benz_Tubules = object
2025-01-05 04:56:37 +11:00
{
union {
2025-01-05 10:18:06 +11:00
#local E = 0.17;
#local R = 0.010;
2025-01-05 04:56:37 +11:00
#for (foo, 0, 360, 20)
2025-01-05 10:18:06 +11:00
#local Tx = E * sin(radians(foo));
#local Ty = E * cos(radians(foo));
2025-01-07 02:05:57 +11:00
#local Dz = z * 1.09;
2025-01-05 10:18:06 +11:00
cylinder { -Dz, Dz, R translate <Tx, Ty, 0> }
sphere { -Dz, R translate <Tx, Ty, 0> }
sphere { Dz, R translate <Tx, Ty, 0> }
2025-01-05 04:56:37 +11:00
#end
}
2025-01-07 02:05:57 +11:00
#if ( rand(Rng1) < 0.333)
texture { Orange_Glass }
#else
texture { Yellow_Glass }
#end
2025-01-05 10:18:06 +11:00
}
#declare Benz_Fuseau = object
{
sphere { 0, RT*0.39 scale <1, 1, 9> }
2025-01-05 04:56:37 +11:00
texture { Gold_Nugget scale 0.56 }
}
2025-01-05 10:18:06 +11:00
#declare Benz_Cylindre = object
{
difference {
union {
2025-01-07 02:05:57 +11:00
cylinder { z*LT*1.6, -z*LT, RT }
sphere { z*LT*1.5, RT*0.72 translate y*RT*0.87}
2025-01-05 10:18:06 +11:00
}
cylinder { z*4, -z*4, RT*0.95 }
}
texture { Soft_Silver scale 6.0 }
}
#declare Benz_Tube = object
{
union {
object { Benz_Tubules }
object { Benz_Fuseau }
object { Benz_Cylindre }
}
}
2025-01-05 04:56:37 +11:00
// ------------------------------------------------------
#declare HexaBenz = object
{
union {
2025-01-07 02:05:57 +11:00
#local Rk = rand(Rng1) * 666.666;
object { Benz_Cones () rotate z*NormClock*Rk}
2025-01-05 04:56:37 +11:00
object { Benz_Tube }
}
}