🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.awk
Article #3

BSP tree to SVG using AWK

#3
From: mike
Date: Wed, 04 Nov 2026 21:16
47 lines
2060 bytes
Hello. Interesting script here (or it was a learning experiance for me).

Script (a bit too long to post so here's a link instead):

<https://drive.google.com/file/d/1cpGSxQLpnFCsGZIAxdx5IKRYdcgAhEye/view>

SGV image created by the script:

<https://drive.google.com/file/d/1y6KriCdbxkRVWtNFeFg3YGpdJgc4sR2N/view>

Notes from the script:

Creates a BSP tree as an SVG image given 2 column input
where input data is formatted as: NAME|QUANTITY
2026 Michael S. Sanders

Here I use...

Apples|32
Oranges|16.2
Bananas|7
Grapes|3.11
Pears|8.43
Mangoes|2
Kiwi|0.50

to calculate each fruit's percentage of the total quantity:

Fruit     Quantity  Share
Apples    32        46.22%
Oranges   16.2      23.40%
Bananas   7         10.11%
Grapes    3.11       4.49%
Pears     8.43      12.18%
Mangoes   2          2.89%
Kiwi      0.50       0.72%
Total     69.24    100.00%

See also...

BSP tree: <https://en.wikipedia.org/wiki/Binary_space_partitioning>

Enjoy.

-- 
:wq
Mike Sanders
Technical Details
Message-ID: <11cg7at$120n2$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: mike <mike@porkchop.nul>
Newsgroups: comp.lang.awk
Subject: BSP tree to SVG using AWK
Date: Wed, 4 Nov 2026 21:16:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <11cg7at$120n2$1@dont-email.me>
Injection-Date: Wed, 04 Nov 2026 21:16:16 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1114850"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+ZYbh7kOyhiCOookRvSTBb"; posting-host="8d377e0641352560372b9a8880e85aa6"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-52-amd64 (x86_64))
Cancel-Lock: sha1:43sNzp2EXbU9/UOSTbhnfo5hTKo= sha256:LSA7WJ9vyu65NCF6GH0aF+T2oe4/3ID0cuGjqqk7W1Y=
	sha1:gLJRPlIUtwEEzFI3pJ911FKLXZ4= sha256:Bobd7h+hqD6ZDnNWeW8xjgkiU2pTeIuErqgeeRz7Hts=