Plotting an equirectangular SVG onto stereographic projection

Github repo.
And by plotting, I mean both converting vector coordinates and tracing the result on a piece of paper. Because it all starts with a pen plotter and a love for mini planets.

It always amazes me when I seem to be the only person on the planet to have a given problem. No matter what combination of keywords I put on a search engine, I just couldn’t seem to find the tool that I needed. I wanted to create a mini planet working exclusively with vector art, specifically with SVG files. You can try breaking down the problem into smaller tasks, but you still will not find the utilities you need. For my specific pipeline, it boils down to three tools:

  • a Blender script to batch-export a panorama composed of several freestyle SVG shots from a given viewpoint;
  • a script to remap the resulting SVGs together in a single equirectangular SVG;
  • a program that takes an equirectangular SVG and remaps the lines/paths in it to stereographic projection.

These tools have been missing for at least 6 years, so it comes as a shock to me that I am ultimately doing something about it. Why not sooner? I guess it’s a combination of hope that “someone will do it for me” combined with finally having the time and resources to do it. This task would have hardly been a “weekend project” before the advent of LLMs and coding agents, but now it can!

The first tool, cube_map_svg.py, is the most straightforward, but potentially the one that can set you up for success or failure downstream. Open your scene in Blender and position your camera where you want it. Configure your camera for a 90-degree FOV. Make sure your camera sensor fit is set to have the same width and height. I usually leave it to 36mm by 36mm. Set the output resolution to 2048×2048, though any square ratio will do. In the script, configure the output directory and keep everything else as is. Don’t forget to enable freestyle output and freestyle SVG in your render panel. Run the script from Blender.

reproj_svg_to_equirect.py will take as input the metadata file generated in your export directory and process each SVG, reprojecting them all into one equirectangular SVG file. When this project was not enhanced by coding agents, I was following the wrong approach and attempting to stitch different SVGs together. It did not go well. GPT-5 largest contribution to me so far was providing the math to project the cube-map into an equirectangular format.

Once you have an equirectangular panorama, you can go crazy with the reprojections. The only one I implemented so far is the stereographic one. svg_stereographic.py helps you make those transformations, taking parameters such as horizontal camera panning, and zoom level.

Here’s some early results using this stack:

Let the penplotting season begin…

2 thoughts on “Plotting an equirectangular SVG onto stereographic projection

  1. @jamez

    dang, dang, dang, i have no time, really, but i feel, i am falling in love with your project… what not to love in it? panoramic projections and SVG… <3 🙂
    as soon as (free)time permit i will bury myself in it till the neck.
    thank you!

Post a Comment through Mastodon

If you have a Mastodon account, .

Post a Comment through WordPress

Your email address will not be published. Required fields are marked *

Name *