Fortraneries/BloubWorld/toinc.awk

27 lines
453 B
Awk
Raw Normal View History

2022-02-06 23:45:08 +01:00
#
# this code is (C) 2022 tTh
#
BEGIN {
count = 0
print "// GENERATED FILE, DON'T TOUCH IT !"
print "#declare Bloubs = object\n{"
print "union\t{"
}
{
2022-03-11 05:47:38 +01:00
if ($5 > 6) color = "Turquoise"
else color = "Sienna"
2022-02-17 14:10:15 +01:00
pigment = "pigment { color " color " }"
printf "\t\tsphere { <%f, %f, %f>, %f %s }\n", \
$1, $2, $3, $4, pigment
2022-02-06 23:45:08 +01:00
count++
}
END {
print "\t} // end of union\n}\n"
print "#declare Nb_Bloubs = ", count, ";\n"
}