From 454b2ddfbb5030eb30e9347d4190f307d135fe0d Mon Sep 17 00:00:00 2001 From: Tonton Th Date: Sat, 29 Nov 2025 21:43:55 +0100 Subject: [PATCH] redesign of "Chose" --- gadgets.inc | 81 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/gadgets.inc b/gadgets.inc index f98dc39..b15a673 100644 --- a/gadgets.inc +++ b/gadgets.inc @@ -4,56 +4,73 @@ */ /* ======================================================= */ +#declare R_C = 0.79; + /* ce truc mérite un nom plus parlant ! */ #macro Chose_le_pied () -#local RCP = 0.70; -merge { +merge { + #local RCP = 0.54; cylinder { 0, y/2, 0.07 } cone { y*0.125, RCP, y*0.250, 0.07 } cylinder { 0, y*0.125, RCP } - #local R = rand(Rng1); - #if ( R < 0.52) texture { T_Beton_1 } - #else texture { T_Beton_2 } - #end - } -#end // macro -// ------------------------------------------------------ ## -/* - * Il doit être possible de dissocier le noyau des tiges */ - -#macro Chose_le_corps () // = object -merge { - difference { - cone { -1.2*y, 0.78, 0.2*y, 1.04 } - sphere { 0.2*y 0.73 } - } - #local CK = NormClock * (9.876+rand(Rng1)); - #for (Foo, 0, 7) - #local CK2 = CK + Foo; - #local C2X = 1.2 * sin(CK2+rand(Rng1)) * sin(CK*3); - #local C2Z = 1.3 * (sin(-CK2+rand(Rng1)) * cos(CK*(rand(Rng1)))); - #local R = 0.06+(0.04*Cos_010(NormClock)); - #local H = 4.2; - cylinder { 0, , R } - sphere { , R } - #end - #local R = rand(Rng1); + #local R = rand(Rng1); + #if (R < 0.25) texture { tPlasticOrange } + #elseif (R < 0.50) texture { tPlasticBlue } + #elseif (R < 0.75) texture { tPlasticPrune } + #else texture { tPlasticGreen } + #end // if + } +#debug "== Fin chose le pied\n" +#end // macro +// ------------------------------------------------------ ## +/* + * Il doit être possible de dissocier le noyau des tiges + * 29 novembre 2025, je tente l'expérience + */ +#macro Chose_les_tiges () +merge { + #local CK = NormClock * (7.876+rand(Rng1)); + #for (Foo, 0, 7) + #local CK2 = CK + Foo; + #local C2X = (R_C + 0.2) * sin(CK2+rand(Rng1)) * sin(CK*3); + #local C2Z = (R_C + 0.3) * (sin(-CK2+rand(Rng1)) * + cos(CK*(rand(Rng1)))); + #local Rt = 0.04+(0.06*Cos_010(NormClock)); + #local H = 3.2; + cylinder { 0, , Rt } + sphere { , Rt } + #end + #local R = rand(Rng1); #if (R < 0.25) texture { tPlasticOrange } #elseif (R < 0.50) texture { tPlasticBlue } #elseif (R < 0.75) texture { tPlasticPrune } #else texture { tPlasticGreen } #end // if - - scale <0.62, 0.5, 0.61> - rotate -y*clock translate y*1.05 } +#debug "== Fin chose les tiges\n" +#end // macro +// ------------------------------------------------------ ## +#macro Chose_le_corps () // = object +difference { + cone { 0, R_C*0.72, 1.2*y, R_C } + sphere { 1.2*y R_C*0.73 } + #local R = rand(Rng1); + #if (R < 0.25) texture { tPlasticOrange } + #elseif (R < 0.50) texture { tPlasticBlue } + #elseif (R < 0.75) texture { tPlasticPrune } + #else texture { tPlasticGreen } + #end // if + translate y*0.50 + } +#debug "== Fin chose le corps\n" #end // macro // ------------------------------------------------------ ## #macro Chose () union { Chose_le_pied () Chose_le_corps () + Chose_les_tiges () } #end // macro