TetaTricks/code/awk/mkunion.awk

22 lines
348 B
Awk
Raw Normal View History

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