adding a lot of grabage

This commit is contained in:
tth
2022-03-18 12:21:40 +01:00
parent dd94a4a2a8
commit ed2b04caeb
13 changed files with 292 additions and 88 deletions

View File

@@ -5,17 +5,22 @@
BEGIN {
count = 0
bx = by = bz = 0.0
print "// GENERATED FILE, DON'T TOUCH IT !"
print "#declare Bloubs = object\n{"
print "union\t{"
}
{
if ($5 > 6) color = "Turquoise"
else color = "Sienna"
age = $5
if (age < 2) color = "Orange"
else if (age > 8) color = "Gray70"
else color = "Sienna"
bx += $1
by += $2
bz += $3
pigment = "pigment { color " color " }"
printf "\t\tsphere { <%f, %f, %f>, %f %s }\n", \
printf "\tsphere { <%f, %f, %f>, %f %s }\n", \
$1, $2, $3, $4, pigment
count++
}
@@ -23,4 +28,7 @@ BEGIN {
END {
print "\t} // end of union\n}\n"
print "#declare Nb_Bloubs = ", count, ";\n"
print "#declare Bary_X = ", bx/count, ";";
print "#declare Bary_Y = ", by/count, ";";
print "#declare Bary_Z = ", bz/count, ";";
}