HexaCone/xperiment.inc
2025-11-15 03:47:04 +01:00

196 lines
4.6 KiB
PHP

/*
* H E X A C O N E - X P E R I M E N T
*
* A cosy place for experimental things (2025/10/27)
*
*/
/* =============================================================== */
#macro Pointe_Wagonnet_0 ()
merge {
cone { 0, 0.06, y*0.33, 0.001 }
sphere { 0, 0.06 }
#local R = rand(Rng1);
#if (R < 0.25)
texture { T_Chrome_1A }
#elseif (R < 0.50)
texture { T_Chrome_2B }
#elseif (R < 0.75)
texture { T_Chrome_3C }
#else
texture { T_Chrome_4D }
#end // IF
}
#end // Macro
/* --------------------------------------------------------------- */
#macro Corps_Wagonnet_0 (Longueur)
object {
/* le corps */
merge {
#local L2 = Longueur / 2;
#local R = 0.25;
cylinder { <L2, 0, 0>, <-L2, 0, 0>, R }
sphere { <0, 0, 0>, R
scale <3, 1, 1>
translate x*L2
}
sphere { <-L2, 0, 0>, R }
/* le kiosque (est-ce un sous-marin ?) */
merge {
#local H2 = L2 * 0.50;
cylinder { <0, 0, 0>, <0, H2, 0>, R/4 }
sphere { <0, 0, 0>, R/4
scale <1, 0.5, 1> translate y*H2
}
scale <2.5, 1, 1> translate x*L2*0.75
}
#local R = rand(Rng1);
#if (R < 0.333)
texture { T_Brass_2C }
#elseif (R < 0.25)
texture { GoldDark }
#elseif (R < 0.50)
texture { T_Chrome_5A }
#else
// texture { Lightning1 rotate z*90 scale 0.09 }
texture { T_Gold_3C }
#end
}
}
#end // macro
/* --------------------------------------------------------------- */
#macro Wagonnet_0 (Longueur)
union {
object { Corps_Wagonnet_0 (Longueur) }
#for (Foo, 0, 5)
#local DX = (-1.5+Foo*0.35);
#local RP = -30 + (60 * rand(Rng1));
object { Pointe_Wagonnet_0 ()
translate <DX, 0.28, 0> rotate x*RP }
#end
object { Repere scale 0.75 translate <0.6, 0.55, 0.25> }
}
#end // macro
/* =============================================================== */
/*
* nouveau du 25 octobre 2025
*/
#macro Une_Arche (Val)
object {
// #debug concat(" Arche, val = ", str(Val, 6, 4), "\n")
merge {
#local Ha = 2;
// mettre une base de la colonne
cylinder { <-1, 0, 0>, <-1, 0.20, 0> Val*1.49 }
cylinder { < 1, 0, 0>, < 1, 0.20, 0> Val*1.41 }
cylinder { <-1, 0, 0>, <-1, Ha, 0>, Val }
cylinder { < 1, 0, 0>, < 1, Ha, 0>, Val }
#if (rand(Rng1) < 0.50)
torus { 0.008, Val*1.08 translate <-1, Ha, 0> }
torus { 0.008, Val*1.08 translate < 1, Ha, 0> }
#else
cylinder { y*(Ha-0.07), y*(Ha+0.01), Val*1.12 translate -x }
cylinder { y*(Ha-0.08), y*(Ha+0.01), Val*1.13 translate x }
#end
intersection {
torus { 1, Val }
box { <-20, -5, 0>, <20, 5, -20> }
rotate <90, 0, 0> translate Ha*y
}
#local R = rand(Rng1);
#if (R < 0.25)
texture { T_Stone40 scale 5+rand(Rng1) }
#elseif (R < 0.50)
texture { T_Stone44 scale 4+rand(Rng1) }
#elseif (R < 0.75)
texture { T_Stone32 scale 5+rand(Rng1) }
#else
texture { T_Stone36 scale 3+rand(Rng1) }
#end
}
}
#end
#macro Les_Arches (EK)
union {
#local E = EK + (rand(Rng1) * 0.50);
object { Une_Arche (0.20) }
object { Une_Arche (0.16) translate -z*E }
object { Une_Arche (0.16) translate z*E }
object { Une_Arche (0.12) translate -z*E*2 }
object { Une_Arche (0.12) translate z*E*2 }
object { Une_Arche (0.08) translate -z*E*3 }
object { Une_Arche (0.08) translate z*E*3 }
}
#end // macro
// ==============================================================
/*
* new Mon Oct 27 04:54:41 PM UTC 2025
*/
#macro Un_Pylone (Type, Hauteur)
#debug " Un pylone ?\n"
#end // macro
// ==============================================================
/*
* nouveau du 12 octobre 2025
*/
#macro Cahute_0 ()
difference {
#local KX = 0.60;
#local KH = 1.80 + rand(Rng1) ;
// #debug concat(" Cahute_0, KH = ", str(KH, 6, 4), "\n")
#local KZ = KX + (0.24*rand(Rng1));
box { <-KX, 0, -KZ>, <KX, KH, KZ> }
#local Mult = 0.97;
#local KX = KX * Mult;
#local KH = KH * Mult;
#local KZ = KZ * Mult;
box { <-KX, 0, -KZ>, <KX, KH, KZ> }
cylinder { <-10, KH*0.70, 0>, <10, KH*0.72, 0>, KX * 0.666 }
#local R = rand(Rng1);
// #debug concat("Random = ", str(R, 6, 4), "\n")
#if ( R < 0.13 )
texture { T_Planete_A }
#elseif ( R < 0.56 )
texture { T_Beton_1 }
#else
texture { T_Beton_2 }
#end // if
rotate y * (277 * rand(Rng1))
}
#end // macro
/* le support des cahutes XXX */
#macro Les_Cahutes ()
union {
#local K = 2.75;
union {
object { Cahute_0 () translate -x * K }
object { Cahute_0 () translate x * K }
object { Cahute_0 () translate -z * K }
object { Cahute_0 () translate z * K }
translate y
}
#local K2 = K + 1.35;
box { <-K2, 0, -K2>, <K2, 1, K2> pigment { Gray30 } }
}
scale 0.5
// rotate -y * (clock*0.33)
#end
// =======================================================
// ==============================================================