TetaTricks/code/awk/mkunion.awk

22 lines
347 B
Awk
Raw Normal View History

2023-02-11 22:19:00 +11:00
#!/usr/bin/awk -f
2024-09-16 12:21:41 +11:00
# create the sdl object: an union of sphere
2023-02-11 22:19:00 +11:00
BEGIN {
2024-09-17 20:23:05 +11:00
nbre = 0
2023-02-11 22:19:00 +11:00
print "#declare Bubules = object"
print "{ \nunion { "
}
2024-09-16 12:21:41 +11:00
# active portion of the code
2023-02-11 22:19:00 +11:00
{
printf(" sphere { <%f, %f, %f>, %f }\n", \
$1, $2, $3, $4 )
2024-09-17 20:23:05 +11:00
nbre++
2023-02-11 22:19:00 +11:00
}
2024-09-16 12:21:41 +11:00
# closing sdl structure
2023-02-11 22:19:00 +11:00
END {
2024-09-17 20:23:05 +11:00
print " }\n}"
printf "// %d bubulles\n", nbre
2023-02-11 22:19:00 +11:00
}