- Posts: 19306
- Thank you received: 0
SVG Magic
4 years 1 week ago #254428
by andypugh
I thought that I had lost this, but just found it again and thought I would share it.
SVG is an amazing format. I am currently using it to present a GUI on a microcontroller. (ESP32). Basically C-code just spits out programatically-generated SVG elements. (See for example: github.com/andypugh/ESP-Heat/blob/master/Programming.ino )
But you are not limited to creating SVG with code, you can have code _inside_ an SVG.
Try opening this file in a web browser. It's a multi-layer SVG of slices of a component (for DLP printing)
www.bodgesoc.org/newfile_script.svg
Now, add a question-mark and a number after the file name in the browser bar, and a small script inside the SVG file will execute and display only that layer.
For example, in my case: www.bodgesoc.org/newfile_script.svg?15
It's like magic
Nothing is happening server-side, this will work just the same if you download the file (and you might want to do that, to look at the script)
SVG is an amazing format. I am currently using it to present a GUI on a microcontroller. (ESP32). Basically C-code just spits out programatically-generated SVG elements. (See for example: github.com/andypugh/ESP-Heat/blob/master/Programming.ino )
But you are not limited to creating SVG with code, you can have code _inside_ an SVG.
Try opening this file in a web browser. It's a multi-layer SVG of slices of a component (for DLP printing)
www.bodgesoc.org/newfile_script.svg
Now, add a question-mark and a number after the file name in the browser bar, and a small script inside the SVG file will execute and display only that layer.
For example, in my case: www.bodgesoc.org/newfile_script.svg?15
It's like magic
Nothing is happening server-side, this will work just the same if you download the file (and you might want to do that, to look at the script)
Please Log in to join the conversation.
- tommylight
-
- Offline
- Administrator
-
Less
More
- Posts: 22010
- Thank you received: 3
4 years 1 week ago #254433
by tommylight
Replied by tommylight on topic SVG Magic
Interesting, thank you.
Pretty sure i read somewhere a while back that SVG can also do 3D and saw an example...
Pretty sure i read somewhere a while back that SVG can also do 3D and saw an example...
Please Log in to join the conversation.
Time to create page: 0.073 seconds
